Sherline Linux (Ubuntu) Version 6.0 with EMC2, updated 10/12/12 Operating Instructions for the Sherline Vertical Milling Machine CNC System P/N 8540/8541, 8020/8021, 8600/8601, 8620/8621 PRECAUTIONS 1. Do not connect or disconnect stepper motors when the driver box is powered up. Always turn off power to the driver box before plugging unplugging a stepper motor. Improperly connecting or disconnecting a motor can damage it. 2.
NOTE: Effective January 2009, Sherline computers no longer come with a floppy drive. A USB flash drive is included instead to facilitate file transfers. Finding the most current instructions The most up-to-date version of these instructions can always be found on the Sherline website at www.sherline.com/CNCinstructions.htm. The following instructions refer to systems utilizing the Ubuntu version of Linux and the EMC2 g-code control program. Older instructions for using the Debian version of Linux 4.
Safety Rules for Power Tools 1. Know your power tool—Read the owner’s manual carefully. Learn its application and limitations as well as the specific potential hazards peculiar to this tool. 2. Ground all tools—If a tool is equipped with a three-prong plug, it should be plugged into a three-hole receptacle. If an adapter is used to accommodate a two-prong receptacle, the adapter wire must be attached to a KNOWN GROUND. Never remove the third prong. 3. Keep guards in place—and in working order. 4.
do the job. Overtightening may damage threads or warp parts, thereby reducing accuracy and effectiveness. 20. Don’t use your lathe for grinding—The fine dust that results from the grinding operation is extremely hard on bearings and other moving parts of your tool. For the same reason, if the lathe or any other precision tool is kept near an operating grinder, it should be kept covered when not in use. 21.
wired, grounded connector cord for your source, the machine will operate anywhere in the world without a transformer. This has been true for all Sherline machines built since 1994. Electronic Filter for CE Approval Sherline now offers an in-line electronic filter between the DC motor and speed control and the incoming AC current that suppresses emissions to meet CE standards.
will not complain and will always work with the instructions that you gave it. You tell it to run, and it will die trying to please you. The Y- and Z-axis screws can be easily oiled; however, the X-axis screw needs special attention. You can’t see it because it is located under the mill table. The best way I have found to lubricate it is to move the mill table all the way to the right, put some oil on your fingertips and transfer it to the leadscrew.
expect a Sherline machine to stand up to the rigors of continuous production use. Continuous use of stepper motor driven leadscrews in a production environment can introduce wear that would be impossible to produce manually. Therefore, slides, gibs, leadscrews, leadscrew nuts and bearings that are subject to high wear due to continuous usage are not covered under this one-year warranty.
and understanding the EMC2 interface and Part 2, which provides workbook examples to walk you through the basics of using g-code. Part 1 A different way of learning Long ago I became aware of the success rate of people who, when left alone with their video recorder and an instruction manual, failed to pass the test and had to stay up late to turn on their recorder to record a show they wanted to save.
was out of choices. I learned by staying up late, working my ass off and making costly mistakes. I would have given my left you-know-what if I had something like this to read rather than reading the junk written by professors trying to prove how smart they were to other professors rather than attempting to teach their own students.
go back to the way you already know or forget the whole idea. I don't want customers who think it'll be easy to learn because they'll be unsatisfied from the beginning and take out their anger on Sherline. You’re about to learn how to control your robot These aren't instruction about operating a simple single system like a VCR, but instructions about controlling a very complicated device.
successful system available to all. I’m learning how to program EMC by using the internet site put together by dedicated EMC users, so you can also fall back to their site for help. See http://www.linuxCNC.org/ . This is going to be easy if you do it my way The Linux operating system works pretty much like all the others. If you can find your way around a Mac or Windows computer, you will have no trouble navigating menus, opening, closing and copying files or saving and deleting items in Linux.
codes can be read throughout the world. g-code standards came about very early in the game because this game was controlled by engineers rather that marketing people. Contouring programs—another world Programs that allow you to do contouring quickly become very complex. Today there are some affordable programs available for sophisticated hobbyists. These programs can create as many problems as they solve, because of the complexity of each program.
you end up screwing up another number there. Take my thirty-five years of experience in dealing with CNC and accept this cutter offset stuff as a fact. I can’t help anyone who isn’t willing to work hard Back in ancient times the great mathematician Euclid told a Pharaoh who wanted to learn geometry the easy way that Pharaohs had to walk down the same road as scholars to education.
Sherline CNC computer from the main menu at Applications>CNC or on-line at http://linuxcnc.org/docs/EMC2_User_Manual.pdf. System Components and Connections NOTE: Computer styles and specifications change often. The photos that follow are for illustration purposes and may not exactly represent computer or components that came with your system. System components: FIGURE 1.
9) Computer with keyboard, and mouse 10) On/Off switch for stepper motor power supply 11) USB drive ports (front) 12) CD-RW drive 13) DC spindle motor 14) Included USB Flash Drive 15) Power On/Off (Smaller button below is “Restart” button) FIGURE 1.
*NOTE: Sherline attempts to ship machines with the voltage setting preset to the proper voltage for the customer’s location. Confirm this setting before turning the computer on for the first time. If the setting is not correct, note that there are two switches that need to be changed. The switch for the driver power supply is inside the computer case. Contact Sherline before opening the case to change the voltage or for any reason. Breaking the tamper-proof seal without authorization may void your warranty.
connection is external and we connect the driver box to the computer through this connector whether the box is mounted externally or built into the computer. EMC or EMC2 will not run with a USB connection. You can also plug in a printer if need be. Now that most printers use a USB connection, this will probably not be something you need to do unless you want to use an older printer.
loaded and running, power to the stepper motors can be turned on. Do not turn on power to the stepper motors unless the EMC program is running. Controls within the EMC prevent overloading of the power supply when multiple motors are powered up at the same time, but without this safeguard motors or drivers can be damaged. Opening the EMC2 Program—Login and Password When starting up, the computer will boot up without asking you to log in.
2. Insert the CD, DVD or USB device into your Sherline Linux computer. When you do, an icon for the device will appear on your desktop. When you double click on the icon, a window will be opened showing the contents of that device. 3. On the desktop of your Sherline Linux computer, double click on the folder named “gcode” to open a new window. 4. Click on the file you wish to move, drag it from the CD, DVD or USB window and release the mouse button to drop it into the “g-code” window.
You can also save a file directly to a CD, DVD or USB flash drive by navigating to the appropriate drive instead of the “g-code” folder (as in step 4 above) and then naming and saving as in step 5. NOTE: In the Ubuntu version of Linux it is no longer necessary to unmount the drive when you are done. Simply close the drive’s window. If using an earlier version of linux, you must “Unmount” the CD or USB device before removing it.
diag.ngc—Tests movement of each axis using small incremental moves. Hint— You will want to rapid to 0,0,0 before you start this program or have something else to do. skeleton.ngc —A sample of code used to create a standard starting and ending condition for a program. This does not show much if you run it but you can copy and past it into your programs and then paste your code in the center. That way you can be certain of the state of the machine after each run. Dome_Test.
• Click the “X” in the upper right corner of the USB drive window to close it. • Remove the drive from the USB port Familiarizing yourself with the control panel The Sherline Graphical Interface By Ray Henry and Joe Martin Start your engines After having connected everything as shown in the reference photos shown previously you will need to turn on the computer but not the motor drivers (the drivers are the individual circuitry that control the stepper motors) to see how this system runs.
FIGURE 1.4—The control panel screen The screen is laid out in sections. The first row is the menu bar across the top. Here you can configure the screen to display additional information. The small buttons that are located left center of the command indicate that they control the large blank section of the control panel that is sometimes called a “pop-in.” This will allow you to view the editor, plotter, tool page and coordinate page.
Directly below the pop-in area on the right side of the screen is the area that is controlled by the chosen mode. In [MANUAL] mode it’s configured so that you manually control the slide movements. You’ll have your choice of “jog” or “incremental” moves using the same big buttons. In [AUTO] mode it displays a set of buttons that allow you to load a part program, view the current location and [Run] it. In [MDI] mode it displays a line where you can enter your command in standard programming code. FIGURE 2.
drawn on the screen. While viewing your tool path from beneath, for example, the movements may appear to be opposite of how you have defined them in your program. Feedhold and Feedrate Override You can operate feedrate override and feedhold in any mode of operation. Override will change the speed of jogs or feedrate in manual or MDI modes. A feedhold will be initiated if you click the [FEEDHOLD] button or if you press the pause button on the keyboard.
[Y] or [y] will shift the focus to the Y-axis. [A] or [a] will shift the focus to the A-axis. To help you remember which axis will jog when you press the jog buttons, the active axis name is displayed on them. Jog Mode The EMC can jog (move a particular axis) as long as you hold the button down when it is set for “continuous,” or it can jog for a preset distance when it is set for “incremental.” You can also jog the active axis by pressing plus [+] or minus [–] keys on the keyboard.
them is the window that shows the part of the program currently being executed. As the program runs, the active line shows in white letters on a red background. The first three buttons, [Open], [Run], and [Pause] do about what you’d expect. [Pause] will stop the run right where it is. The next button, [Resume], will restart motion. They are like “feedhold” if used this way. Once [Pause] is pressed and motion has stopped, [Step] will resume motion and continue it to the end of the current block.
[Restart] button. A restart is a good time to use feed rate override and the pause key on your keyboard. MDI MDI mode allows you to enter single blocks and have the interpreter execute them as if they were part of a program—kind of like a one line program. You can execute circles, arcs, lines and such. You can even test sets of program lines by entering one block, waiting for that motion to end, and then enter the next block. Below the entry window, there is a listing of all of the current modal codes.
clicking the file name will also open it.) If you highlight a section of text and use the Edit>Copy commands you can then open another program and use the Edit>Paste commands from the menu to paste the lines of code into the new program. This editor does not have the ability to automatically reload the program into the EMC interpreter after a change. You will need to do that in EMC2 by selecting the file after saving it. Backplot [Backplot] will show the tool path that can be viewed from a chosen direction.
optional 18" mill table (P/N 54182) with about 13.65" to 14" of X-axis travel and an optional 15" mill column (P/N 45260) that adds 4 more inches to Z-axis travel. Programming and Operating Your Sherline CNC Vertical Mill By Joe Martin Manual vs. CNC Let’s think about what we have to do to write a program for CNC: 1) Create a spot on your storage system. 2) Write a program. 3) Test it for errors using the Backplot program.
3) Now that we have a program loaded and the Backplot program running, let’s take a break and test our setup. Make sure that [ESTOP] is active with the button highlighted and execute [Run]. 4) Observe that the programmed moves can be viewed in the Backplot box and the viewing area can be controlled with a variety of controls. This is very useful in checking out the programs you’ll be writing in the upcoming lessons.
This will remind you to only use the 0-new program to set yourself up for creating a new program. Use the File>Save command. Remember, to make any changes permanent you must save the changes before closing the program. 2) We’ll now use the [Save As] command to save the 0-new file with the new name testg02. By using the [Save As] command you also leave the 0-new program as is to use again. You can create your own files and name these files as you wish from this point on.
FIGURE 2.2—Mill axis directions in relation to the operator. Directions of axis movement on a mill Before we go on, let’s be sure we understand the directions of movement of the three axes of a milling machine. When programming g-code you will use the Cartesian coordinate system. In relation to the machine operator, the X-axis moves left/right, the Y-axis moves in/out and the Z-axis (spindle) moves up/down.
operations like milling a large round part or drilling circular hole patterns easier to program. It also allows you to do operations like milling threads or helical gears that would not be possible without CNC because a rotary axis and a linear axis must move at the same time and in the proper relationship to each other to create the desired tool path.
Your Linux computer already has a program installed that will allow you to read .pdf files by clicking on them. To view .pdf files on your Windows® computer, a copy of the free program Acrobat Reader will need to be installed if it isn’t already. Clicking on a .pdf file should cause that program to open automatically. If you don’t have it or want to get the latest version, go to www.adobe.com/products/acrobat/readstep.html. Inch vs.
reading them now. They are quite simple. Remember that modal g-codes remain in effect until the control receives a new g-code that over-rides the present code. Modal g-codes control function, direction or speed and, in general, cannot be used in the same line of code with other modal g-codes for obvious reasons.
with some fonts and are located close together on any keyboard. You are not writing a letter when you program, and it has to be accurate. Circle program Note: In these instructions, the code you should retype into your program will always shown in bold face red type. The entire program: % (g02 circle program) g01 g20 g40 g49 g90 x0 y0 z0 f2 g02 x0 y0 i-.5 j0 g01 g90 x0 y0 z0 f2 m2 % 1) % –Always start a new program with a % sign. This informs our robot that a program is coming in.
D) g49–Cancels any unwanted tool length compensation that may have been left active from previous run programs E) g90–Orders the machine to use the absolute coordinate system where the position will always be referenced from a zero point. Again, you can zero the axis by going to [Pop In] [Offset]. F) X0, y0, z0 is self evident. If the slides weren’t in the 0 position they would have moved to it. This is the basic information that all programs should start with.
7) m2-Informs the computer the computer the program has come to an end. 8) % -The standard format of EMC or EMC2 is to start and the entire program with a percentage sign. 9) Now we have to load this program for your machine to run. [File] [Save and Load] In this case we are not ready for prime time, and we are going to check our program with [Pop In] [Backplot]. 10) One more check –the program should look like this: % (circle g02) g01 g90 x0 y0 z0 f2 g02 x0 y0 i-.
Don’t ever press the green [Start] button on a CNC machine unless you know exactly what the machine will do BEFORE you PRESS IT! Now let’s take a closer look at that minus change we made and we’ll see what happened is really obvious. By changing the “i” to a positive number the center of the radius is now moved to the positive side of our zero starting point, which in this case is a total distance of 1".
I’m buying I’m a little bored with this exercise myself so let’s drop over to route g41 and see what’s going on. The programmers that reside on g41 are a little on the snobby side because they think they have some special talent that us regular guys can never learn. That was probably true when they learned it, but they didn’t have Joe Martin teaching them.
This allows you to measure the tool length directly with calipers by measuring the overall length of the holder with the tool mounted. Also remember that the home stopping position for the z-axis shouldn’t be zero. It should be a positive number that allows you to change the tool if necessary. The x0, y0 and z0 position should be chosen carefully and be related to the part that is being programmed, not to a convenient place to change tools.
Figure 2 Safety first I believe you shouldn’t approach the work at this time in a rapid g00 mode for safety reasons; therefore, all my examples will include a short section of controlled feed rates before the point of contact is reached. My program examples will always be complete and will run on the backplot program that comes with your system.
The coming programming examples don’t use this method of bringing the cutter up to the part because it wasn’t necessary in my examples. In the real world, this will be a problem that you’ll regularly encounter, and you’ll have to use every trick in the book to produce the parts that are needed. For the time being, remember that the closer you align your cutter (aircraft) with the directional edge that you want to machine (runway) the better the landing.
10) g40 x1 y1 z1 –And home. 11) m2 – End program. 12) % –Park it and have a coffee. Good flight! The diameter was generated as before, but this time the final size of this diameter will be controlled by the diameter entered in to the d1 location. By entering a diameter larger than the actual tool, which is 0.375", we are assured that the diameter will not come out undersize, because it keeps the spindle farther away from the finished edge.
x-1.910 y1.910 x-.090 y.100 z-.150 x-1.900 y1.900 x-.100 y.100 x-.200 y-.200 g00 g40 z1 x1 y0 z1 m2 % Nothing worth commenting about in that program except that my final move before canceling cutter comp was to eliminate a burr that would have formed if I had gone straight out, and you should be able to figure rest it out yourself. What you can do is set the value of d1 at a very small diameter and run the program through.
Here is an interesting little program I wrote: The atomic circle program Figure 4 The entire program: % (atomic circle) g90 g17 g40 g00 x0 y0 z0 g03 x0 y0 i0 j1 f100 g02 x0 y0 i0 j-1 g03 x0 y0 i1 j0 g03 x0 y0 i-1 j0 g18 g03 x0 z0 i0 k1 g02 x0 z0 i0 k-1 g03 x0 z0 i1 k0 g02 x0 z0 i-1 k0 g19 g03 y0 z0 j0 k1 g03 y0 z0 j0 k-1 g02 y0 z0 j1 k0 g03 y0 z0 j-1 k0 g90 g17 g40 g00 x0 y0 z0 m2 % Run it on the backplot program.
step this program through and again be sure you are positive that you can understand every move made so well that you can explain to someone what the move is and why it is going to make it this or that way before going on. Our class is very understanding and we are all going to wait for you while you go back and catch up, but don’t let it happen again. The Great Race Instead of R/C, let’s go PC aircraft racing. We'll watch the race using the backplot program. First, set the tool diameter to 0.600" in d1.
x-4 y1 z.5 z0 x-1 y1.5 z.5 z0 y.5 g00 x-1.6 y.8 g01 y1.8 f100 (course complete) (Taxi to starting line) x-1.6 y1.3 f15 m00 This will pause the program while you get ready to set your stop watch. To start the race you’ll have to use [Resume] button because the [Run] button will not restart the program when it is in a “paused” mode caused by the m00. Now for the race… (Use resume button to start race) x-2 f6 x-4 y1.4 z.5 f10 g03 x-4 y.6 i0 j-.4 g01 g42 d1 x-3 y.5 f20 x-2 x-1 y.5 y1.5 (lap 2) x-4 y1 f25 x-1 y.
x-1.123 y.578 y1.373 x-1.6 (race over) g40 x-3.5 z1 x-4 y1.5 g03 x-4 y.5 i0 j-.5 g01 g90 x-2 g18 g02 x-2 z1 i0 k1.5 g01 g90 g17 x2 g02 x2 y-.5 i0 j-.5 g01 x-2 z0 f20 x-2.5 z.15 f15 x-3 z0 f10 x-3.2 z.1 f5 x-3.4 z0 x-3.6 z.05 x-3.7 z0 g03 x-3.7 y-.9 i0 j-.2 g01 g90 x-1 f25 g03 x-.5 y-.4 i0 j.5 f15 g01 y.5 g03 x-1 y1 i-.5 j0 g40 g90 g00 x-1 y1 z0 m2 % The same program with comments from the pilot: x-2 f6 –Gaining airspeed and lift-off x-4 y1.4 z.5 f10 –Climbing out and headed for turn 1 g03 x-4 y.6 i0 j-.
(top speed) x-1.123 y.578 –We tighten up the course for the rest a race Figure 6 I cheated and used AutoCad®… y1.373 (lap 4) x-3.862 y.961 x-1.123 y.578 y1.373 (lap 5) x-3.862 y.961 x-1.123 y.578 y1.373 x-1.6 (race over) –We won g40 x-3.5 z1 –Turn off the navigational aid and climb out x-4 y1.5 g03 x-4 y.5 i0 j-.5 – A nice lazy fast turn g01 g90 x-2 g18 g02 x-2 z1 i0 k1.5 –We change planes and do a victory loop g01 g90 g17 x2 –Enter the landing pattern back in x, y plane g02 x2 y-.5 i0 j-.
x-3.7 z-.01 –I think I dented their runway z0 g03 x-3.7 y-.9 i0 j-.2 –Let’s get out of here before they remember me for that lousy landing g01 g90 x-1 f25 –A nice fast taxi home g03 x-.5 y-.4 i0 j.5 f15 g01 y.5 g03 x-1 y1 i-.5 j0 g40 g90 g00 x-1 y1 z0 –Home at last. I wonder if they’ll remember my lousy landing more than our win m2 % NOTE: For those who have purchased the complete CNC system with computer, this program has been added to the “g-code” folder as “TheGreatRace.
I want you to write a complete program on your own to profile this part. To pass the test, you must use cutter comp. I have taught you all the fundamentals to write this program, and the only suggestion I will make is to test the program a segment at a time as you write it. That’s the great advantage of having Ray Henry’s backplot program to work with. Change a couple of dimensions and make one end square and take another test.
When programmers solve for tangent points, they usually start off knowing the hypotenuse of the triangle they are working with, because it is the radius of the arc of which they are solving for the start and stop points. The hardest part of this part of the course isn’t solving a right triangle. It’s finding the correct right triangle to solve to give you the answer to determine your tangent coordinates that will determine the start and stop points of an arc.
Figure 10 First, what two things do we have to solve this triangle? We have the hypotenuse because it is the radius of the arc and the 5° angle. From our tables we see that the 0.0436 was derived by multiplying the hypotenuse (0.5) times the sin 5°; and the 0.4981 was the product of 0.5 x cos 5°. This will give us our end-of-arc position. The 0.0476 has to be calculated to give us the final X-axis point of the angle. We can easily calculate the 0.5436 because it is the sum of 0.500 and 0.0436.
Figure 11 This program is just an exercise, and I’m not going to write any Z-axis code. The 0 starting point is located in the upper right-hand corner. Of course, we’ll also use cutter comp to generate this shape. Now, read the code I wrote and examine Fig. 11 again and visualize where the starting and stopping points are in your mind before you run the program in backplot. This is what we are striving for, because a real professional programmer can read code like a letter.
x.5 g00 g40 g90 x0 y1 z0 m2 % With comments % g00 g40 g90 x0 y1 z0 g41 d1 x0 y.5 g01 y0 f16 Last time, I started at y1 position so I could enter into the cutter comp mode in two moves and coming in from the correct direction (remember—gear downtouch down). y-2.000 x-1.7032 g03 x-2.2013 y-2.4564 i0 j-.5 –Last time, The x and y positions where the arc ends. g01 x-2.2488 y-3.000 x-4.000 y0 x0 x.5 –Exiting g41 mode in correct direction.
In this problem all we know is the radii of both circles and the distance between them, yet we have to arrive at the tangent points. Figure 13 Here is the real problem. The seemingly obvious way of solving this problem would be to solve the angle that can be generated with the differences between the radii and the distances between centers and then use this information to come up the needed points. Wrong. Compare the two angles in Fig. 14 below.
Figure 14 Believe me, I studied this problem for a long time before I was able to solve it. I also came up with unusually simple way to arrive at the second side of the right triangle so the problem was solvable. I don’t want to blow my own horn, but it is extremely rare that an individual like myself, who hasn’t studied high math, will ever come up with a complex mathematical rule on his own that works, whether mathematicians know about it or not.
Figure 16 Let’s write the code for this simple yet not-so-simple shape. One thing I must state again is that I’m having a terrible time with careless errors. I think the problem is that I’m more worried about how I’m going to explain each problem than I am in entering the correct numbers. Don’t fall into my trap. You don’t have to explain to me how you did it, so learn from my mistakes. Become a hermit while you are studying so you don’t make careless errors.
I believe that you should be able to follow the pulley program without comments now that you have calculated the tangent points. Our next problem is linking to arcs together, and in this case the arcs are going in opposite directions. What I want you to notice in this particular program is the fact that you enter cutting the second 0.300 radius from the opposite direction as you did in the same radius on the opposite side. This changes the i and j values going in and coming out.
Figure 18 Don’t just look at my answers and assume they are right. In the real world you don’t solve problems you know the answers for. I’m writing this stuff for you to teach you how to do it. I already know. Be original and change a few basic dimensions and see if you can be confident that your answers are correct. That’s what it is all about. Don’t find out that you don’t know how to do it by making bad parts. We are machinists who don’t have erases to work with.
m2 % Figure 19 The rod program adds a useful new tool to our collection. The “r” letter designates “radius” when it’s used in the same block as the circle command g02 or g03. This simplifies code writing because it eliminates the need to calculate the “I” and “j” points that are always changing as seen in our last example; however, the start and end points of an arc must be calculated to the same degree of accuracy.
g01 x-1.6844 g03 x-1.5638 y.1858 r.15 g02 x-1 y0 r.3125 g01 y-.1 g00 g40 x-.5 x0 y0 z0 m2 % EMC Tip—Pausing a cut during a long program If for some reason you have to stop your machine while it's running a long program and you are planning to complete the part the next day, the safest way to accomplish this is to stop the program by using [FEEDHOLD]. Turn the spindle and servo driver off, but leave the computer on.
3. Machining the same shape in different locations. Sub programs can be short and simple or very long and intricate. EMC2 uses “o” codes (this is the letter o, it is not Zero) for programming sub programs. Sub programs should be written in a g91 incremental format. If g90 was used the sub program would only run in a single location; however, you could use g90 if you reset your home position with a g92 before calling up your sub program.
g00 z.3 y.25 g01 z-.3 g00 z.3 x-.25 g01 z-.3 g00 z.3 o200 endsub g90 g00 g40 g80 x1.0 y1.0 z0 program) o200 call (move into position for the starting point of the sub (call up sub program o200) g90 g00 x1.0 y-1.0 z0 (A g90 must be entered in the line of code calling for its next position move) (Be sure to have your spindle high enough to clear all obstacles such as clamping devices.) o200 call (call up sub program o200) As many times as needed.
g01 z-.3 g00 z.3 o300 call (x move) o200 endsub o300 sub (mill shape) (mill shape g-code) o300 endsub (Main Program with a Sub Program Nesting Sample) g90 g00 g40 g80 g54 g17 x0 y0 z0 g90 g00 x1.0 y1.0 (move into position for the starting point of the sub program) o200 call (4 hole pattern) g90 g00 x4.0 y1.0 o200 call (4 hole pattern)(Which also calls o300 sub (mill shape)) g90 g00 g40 g80 x0 y0 z0 m2 % Again: 1. All o-codes must be defined by numbers (EX. o200, o154, etc). 2.
the time to become more proficient with the skills you have learned up to now. Although these remaining commands are easier to learn than the ones you have been using, I’d suggest you take a look at my last two programs at the end of this section and read my closing comments before going on. Though you now know enough to make parts without them, the following g-commands, when used appropriately, can eliminate many lines of code from your programs and allow you to enjoy the full power of EMC.
g40 g20 g90 g00 g80 z2 x0 y0 g81 x2 y1 z-0.50 r0.010 f3 x3 x4 g00 g80 x0 y0 % The g82 command G82 is intended for drilling when you want a dwell at the bottom of the hole. (I find this a bad idea when drilling, because some of the more exotic metals like stainless steel may work harden and cause the drill to become dull sooner than it should.) 1. Move the z-axis only at the current feed rate to the z position. 2. Dwell for the given number of seconds.
1. Move the z-axis only at the current feed rate downward by delta or to the zposition, whichever is less deep. 2. Retract at traverse rate to clear z 3. Repeat steps above until the z-position is reached. 4. Retract the z-axis at traverse rate to clear z. Example using a ¼" drill and putting 3-holes in 1.00" deep: % g00 g40 g20 g90 g80 z2 x0 y0 g83 x1 y1 z-1 r0.010 q.25 f2 x2 x3 g00 g80 x0 y0 % The new command to learn is q. The g84 command G84 is intended for right-hand tapping.
The g89 command G89 is intended for boring and uses a p value, where p specifies the number of seconds to dwell at the end of the hole. The problem with dwelling at the bottom of a bored hole, especially with a machine as light as a Sherline, is that tools have a tendency to chatter. I usually don’t bore a hole to the exact bottom unless it is absolutely necessary.
Example using a ¼" drill and putting 3-holes in a row 1/4" deep: % g00 g20 g40 g80 g90 z0.50 x0.50 y0 g91 g81 g98 x1 y0 z-0.30 r-0.45 L3 f3 g00 g90 g80 x0.50 y0 % Example using a ¼" drill and putting 12-holes ¼ " deep: % g00 g20 g40 g80 g90 z0.50 x0.50 y0 g91 g81 g98 x1 y0 z-0.30 r-0.45 L4 f3 x0 y1 x-1 y0 L3 x0 y1 x1 y0 L3 g00 g90 g80 x0.50 y0 m2 % An explanation of each line of code: % g00 g20 g40 g80 g90 z0.50 x0.50 y0 – Home position g91 g81 g98 x1 y0 z-0.30 r-0.
More on the “L” command… Sherline’s shop foreman Karl Rohlin offers this sample "L" program, which is based on one we used in our own factory. It uses a standard g81 canned cycle with the "L" added to the canned cycle. (Note: Again, the letter “L” is capitalized here because the lower case letter “l” is often confused with the numeral “1”.) This is a g81 canned cycle that uses an "L" function to drill multiple, evenly spaced holes. (Drill 5 holes .
Change n10 to (g91 g81 x0 y0 z-.3 r-.1) (No "L" on this line. Now it will drill one hole at x0,y0). Now insert n12 (x.25 y0 r0 L4) (Now it will move to x.25, x.5, x.75, & x1.0 and drill to z-.40 at each place.) Note: Because the next move on line n15 is in incremental, the tool will move to Absolute position x1.0, y.250, then line n20 will drill (4) more holes and end at x0, y.25. The g92 and g92.
The g99 command G99 avoids retracting a drill all the way up to the original z-position between moves, thus saving valuable time on a project that involves hundreds of holes. Example using a ¼" dia. drill and putting 8 holes ¼ " deep: % g00 g20 g40 g90 g80 z0.50 g91 g81 g99 x0 y0 z-0.30 r-0.45 f4 x1.5 y0 r0 x1 y0 L2 x0 y1 x-1 y0 L3 g98 g00 g90 g80 z0.50 x0 y0 m2 % This program looks pretty much the same as the program that uses g98; however, there’s a significant difference. Note the added r0 in line 4.
x2.500 g01 z-0.250 g00 z0.050 x1.500 g01 z-0.250 g00 z0.050 x.500 g01 z-0.250 g00 z0.050 z0.500 x0 y0 m2 % Now consider how much programming labor these canned cycles can save once you learn them. Twenty-eight lines of code was reduced to nine lines; however, I spent far more time just learning why you have to put the r0 in programs using the g99 command than I did writing the above program, especially when you can just use the [Copy] and [Paste] commands.
immediate practical need for small precision parts, you are on your way to joining the leading edge of today’s modern machinists. Again, you should remember that Sherline hasn’t charged you a penny for the custom EMC2 program even though we have spent many thousands of dollars designing a system and writing instructions that an average hobbyist can understand.
FIGURE 20—The Sherline 8730 CNC Rotary Table with stepper motor can be plugged directly into the A-Axis cord pre-wired into your computer to operate as a 4th axis. Definitions and Codes The word definitions listed below were copied from the Linux CNC website. It’s where I gathered the information to write part two of these instructions. It’s worth reading and using to go to the next step in programming, but for the time being stick with just my instructions.
I have highlighted in red bold face the main words we’ll be working with when using a Sherline machine, and, although many of these words we will not directly use, I wanted you to be aware of the codes used in industry. A CNC program “word” is defined as an acceptable letter followed by a real value.
Table 3—g-code List g0 rapid positioning g1 linear interpolation g2 circular/helical interpolation (clockwise) g3 circular/helical interpolation (counterclockwise) g4 dwell g10 coordinate system origin setting g17 xy plane selection g18 xz plane selection g19 yz plane selection g20 inch system selection g21 millimeter system selection g40 cancel cutter diameter compensation g41 start cutter diameter comp. left g42 start cutter diameter comp.
There is some question about the reasons why some codes are included in the modal group that surrounds them. But most of the modal groupings make sense in that only one state can be active at a time. Note: It isn’t necessary to try to remember the words I highlighted. You’ll learn these as we go. Handy Tip: Milling threads without a cnc rotary table. You can mill threads using a rotary table to turn the part; however if you don’t have a 4th axis, this program would do the job.
Frequently Asked Questions The “Instructions and Utilities” CD that came with your computer or driver box contains a “Frequently Asked Questions” file called CNCfaq.pdf. An up-to-date version is also available on the Sherline website at www.sherline.com/CNCfaq.htm . This page will answer many of the questions a new user might have about Linux, EMC, g-code and other aspects of CNC. General machining questions are addressed at www.sherline.com/faq.htm .