Version 4e (Linux v4.xx), updated 12/5/06

(New in 4e version: Instructions added to "FAQ" section on how to correct for a radius start or end point error message and how to mill threads. Also added are instructions on using the g92 command.)

Operating Instructions for the Sherline Vertical Milling Machine CNC System

P/N 8540/8541, 8020/8021, 8600/8601, 8620/8621

The most up-to-date version of these instructions can always be found on the Sherline web site at www.sherline.com/CNCinstructions.htm. These instructions refer to systems with the Debian version of Linux 4.xx distributed by Sherline starting January 1, 2005. Instructions using the older 2.xx Redhat version of Linux will remain posted on the web as well. (Typographical errors found in some of the sample g-code programs in the instructions have been corrected in both versions.)

CNC LATHE USERS

Purchasers of Sherline CNC lathe systems can also use these instructions, as the basics of CNC apply regardless of the machine being run. Keep in mind that lathe operations will require somewhat different g-code simply because of the way parts are made on a lathe.

USE OF NON-SHERLINE PROGRAMS

Sherline cannot be responsible for the support of software or hardware products not designed or sold by Sherline. For questions on Windows® CAD, CAD/CAM, control or utility programs, please contact the seller of the software. It would be impossible for Sherline to guarantee that g-code generated by any particular CAD/CAM program will run on EMC without modification. A thorough knowledge of g-code programming will always be useful to eliminate problems caused by post processors.

Table of Contents

(Click on any underlined item to go directly to that part of the web page.)

Safety Rules for power tools Part 2, Operating Instructions (G-code)
Electrical Connections

Circle Program

Lubrication

Rectangle with Cutter Compensation

CNC System Warranty

Atomic Circle

Technical Support

The Great Race

A Short History of CNC

A Test to See How You Are Doing

A Different Way of Learning

Back to School (Trigonometric Functions)

Part 1, Operating Instructions (Files, Use)

Rectangle, Arc and Tangent

System Components and Connections

Pulley Program

Assembling Your System

Rod End

Computer Operation and File Navigation

Connecting Rod

Installing a CD writer

  ∙ More Handy G-Codes (and canned cycles)

The Control Panel

Using the 4th axis

Introduction to Programming and Operation

Conclusion

Using Backplot to Check your Program

Definitions and Codes (A list of G, M codes)

  ∙ How to Create a File of Your Program Frequently Asked Questions

Safety Rules for Power Tools

1. Know your power toolRead the owner’s manual carefully. Learn its application and limitations as well as the specific potential hazards peculiar to this tool.

2. Ground all toolsIf 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 placeand in working order.

4. Remove adjusting keys and wrenchesForm a habit of checking to see that keys and adjusting wrenches are removed from the tool before turning on any machine.

5. Keep work area clearCluttered areas and benches invite accidents.

6. Avoid a dangerous work environmentDo not use power tools in damp or wet locations. Keep your work area well illuminated.

7. Keep children awayAll visitors should be kept a safe distance from the work area.

8. Make your workshop “kid-proof” with padlocks, master switches or by removing starter keys.

9. Do not force a toolDo not force a tool or attachment to do a job for which it was not designed. Use the proper tool for the job.

10. Wear proper apparelAvoid loose clothing, neckties, gloves or jewelry that could become caught in moving parts. Wear protective headgear to keep long hairstyles away from moving parts.

11. Use safety glassesAlso use a face or dust mask if a cutting operation is dusty.

12. Secure the workUse clamps or a vise to hold work when practicable. It is safer than using your hand and frees both hands to operate the tool.

13. Do not overreachKeep your proper footing and balance at all times.

14. Maintain tools in top conditionKeep tools sharp and clean for best and safest performance. Follow instructions for lubrication and changing accessories.

15. Disconnect toolsUnplug tools before servicing and when changing accessories such as blades, bits or cutters.

16. Avoid accidental startingMake sure the switch is “OFF” before plugging in a power cord.

17. Use only recommended accessoriesConsult the owner’s manual. Use of improper accessories may be hazardous.

18. Turn the spindle by hand BEFORE switching on the motorThis ensures that the workpiece or chuck jaws will not hit the lathe bed, saddle or crosslide, and also ensures that they clear the cutting tool.

19. Check that all holding, locking and driving devices are tightenedAt the same time, be careful not to over tighten these adjustments. They should be just tight enough to 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. Don’t let long, thin stock protrude from the back of the spindle—Long, thin stock that is unsupported and turned at high RPM can suddenly bend and whip around.

22. Wear your safety glassesForesight is better than NO SIGHT! The operation of any power tool can result in foreign objects being thrown into the eyes, which can result in severe eye damage. Always wear safety glasses or eye shields before commencing power tool operation. We recommend a Wide Vision Safety Mask for use over spectacles or standard safety glasses.

23. Disconnect the computer from all power sources before opening case—With the computer power switch off, some of the internal components of your computer are still electrical hazards and can provide a severe electrical shock. Disconnect the computer from the power source before opening the case to eliminate this possibility of an electrical shock.

24. Static electricity can damage your computerBe sure you are properly grounded before touching any components inside your computer. A spark of static electricity can damage delicate circuits in some components in your computer. Either wear an approved static electricity grounding strap around your wrist or touch the case of the computer with one hand before touching any components with your other hand.

25. Be sure you know what will happen BEFORE pushing the [START] buttonRun your program in [BACKPLOT] mode before running the actual part to make sure it will run the path your are expecting. Make sure your machine is in the proper home position before starting the operation.

Electrical Connections

The power cord supplied is equipped with a 3-prong grounding plug that should be connected only to a properly grounded receptacle for your safety. Should an electrical failure occur in the motor, the grounded plug and receptacle will protect the user from electrical shock. If a properly grounded receptacle is not available, use a grounding adapter to adapt the 3-prong plug to a properly grounded receptacle by attaching the grounding lead from the adapter to the receptacle cover screw.

NOTE: The electrical circuit designed into the speed control of your lathe or mill reads incoming current from 100 to 240 volts AC and 50 or 60 Hz and automatically adapts to supply the correct 90 volts DC to the motor. As long as you have a properly 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.

Stepper Motors: Do not disconnect the cord at the stepper motor end unless absolutely necessary. It is designed for limited use and can be easily damaged. When connecting and disconnecting the motors, always use the round plugs that connect to the driver box cables.

Lubrication

CNC machines require more attention to keeping the leadscrews properly “oiled” than manual machines. When you crank the handles by hand you can quickly realize that a slide is going dry because you can sense the results of the extra drag. A CNC machine 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. As the table is moved back to the left, oil will find its way to the internal brass nuts. Remember, that any type oil is far better than none. The slides also require constant oiling. I believe these oiling procedures should be done after every four hours of operation. For more on lubrication see page 5 of the Sherline Miniature Machine Tools Assembly and Instruction Guide that came with your mill.

CNC System Warranty

If within one year from the date of purchase of a new Sherline CNC system any tool or component fails due to a defect in material or workmanship, Sherline will repair or replace it free of charge. In addition, it has always been our policy to replace at no cost all parts, regardless of age, which are determined to have been incorrectly manufactured or assembled and have failed due to this cause rather than because of improper use or excessive wear caused by continuous use in a production environment. In cases such as this, Sherline will inspect the machine or part and will be the sole judge of the merit of the claim.

Freight charges for returning a machine are not covered. Save the original packaging material to use if the machine or computer must be returned to the factory for service. Sherline will not participate in insurance claims where the sender didn’t make an honest effort to package the items to prevent damage caused by normal shipping stresses or repair said damage without charging the sender.

Merchandise that has been abused, misused, improperly maintained or insufficiently lubricated is not subject to warranty protection. Proof of date of purchase and dealer name may be required for service under this warranty.

Specific exclusion for wear due to production use

Although many Sherline tools have found there way into production environments, they have been designed for intermittent use in home shops. It would be unreasonable to 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.

Non-warranty service and machine tune-ups

Sherline machines are easy to service, and all replacement parts are available from the factory. However, if in the future you wish to return your machine for any reason to have Sherline repair or adjust it, we will be glad to do so. Our shop rates are very reasonable and our production people have all the proper tools and fixtures to repair or service your machine quickly and return it to factory new condition.

Returning machines or parts for warranty or non-warranty repair

Before returning any tools or parts for repair, please call first and obtain a Return Authorization (RA) number so that we can process your order immediately upon receipt. Remove all non-essential parts from the machine to save shipping weight and return only the portion to be repaired. Wrap and package all parts securely so they cannot move around in shipment. We recommend that heavy parts be double-boxed. Include a brief written description of the desired repair and your return address and phone number or e-mail address inside the box so we can contact you if questions arise. Repairs are normally return-shipped the next workday after they are received.

Technical Support

If you have technical questions that are not answered in these instructions, you should consult with the developer's of Linux and EMC through their web site at www.linux.org. Linux developer and expert Ray Henry is available for consultation at $60.00 per hour. Ray is an expert in the many phases of the Linux EMC CNC program including Installation, CNC programming, the Sherline CNC mill and the Linux operating system. You’ll find Ray a very pleasant and knowledgeable person to deal with. Use your time wisely by making every attempt to solve your particular problem yourself by re-reading the instructions and working through the program before calling. Ray can be contacted at rehenry@up.net or (906) 875-6692, 9 AM-9 PM (Central Time Zone).

Remember that Sherline hasn’t charged you a single penny for the Sherline version of the EMC program even though we have spent a considerable amount of money and time adapting the EMC program to the Sherline mill. We also don’t have anyone available at Sherline with Ray’s expertise to answer programming and installation questions. However, if you have a problem with a machine, component or accessory manufactured by Sherline, please feel free to contact us.

A short history of CNC

I’ve been personally involved with CNC since the early seventies and soon realized that this was the way to make things. Back then all sorts of ideas were being tried to simplify the mass production of machined parts. Many manufacturers were using hydraulic power and came up with some interesting systems. The method of choice before NC (back then they were called Numerical Control (NC) because the storage device was a one inch wide paper tape) was a tracing system that duplicated parts by tracing them with a hydraulic system controlled by a really neat valve controlled by a stylus that the operator would move like a probe and the machine would duplicate their movements. Gigantic machines were built around this idea for the aircraft industry.

Hydraulic CNC systems?

It was only natural that this was the group of manufacturers would be the first to try this new field, and did they ever come up with some weird systems. You also have to realize that electronics were also pretty crude during that same time period. My first NC machine was a Cinematic manufactured by Cincinnati machine tool. It had ball lead screws driven by hydraulic motors and was fairly reliable and quite popular at the time. Tool changers were still in their infancy. I ran it until it was so out-dated that I gave it away when it still ran. Another interesting point is this machine had a “wire wrapped” control with few circuit boards. If a recent graduate of electronic engineering had ever looked into the control enclosure, I’m sure his first comment would be “impossible.”

I thought I bought a telephone company

My first machine that was controlled by electronics turned out to be a disaster. I bought it used and it had a stack of manuals 18 inches high. I never dreamed I was going to look at every page but I did. When I opened the control and looked in there, I thought I bought a telephone company. I believe there were 120 individual circuit boards and thousands of individual transistors. It was manufactured by Edlund. We used to call it a “Deadlund.” I wasted more time and money on that machine than I care to admit, and I felt relived as it was loaded on a truck for its final journey to the junkyard.

Problems with no memory storage

The way this machine stored memory was interesting. At this time there weren’t any memory storage devices invented for commercial use. What this control did was feed a single block of code (a block of code contained the instructions the machine needed to make a single move) into a very long piece of Ni-chrome wire. The high resistance of the wire would delay the signal long enough so the signal could be amplified at the other end and sent back on the same wire without interference. The signal would then bounce back and fourth until the machine had moved to a location that corresponded to that block of code.

Sometimes I can be persistently stupid

New machines were thousands of dollars more than I could afford and not that reliable either. I remember a friend who had a three-year-old machine that cost over $100,000 that needed service. The first thing the technician said was, “I didn’t think they had any of these old bastards still running.” You can imagine how my friend felt when he made that $2500 payment each month.

You’d think I would have learned by then, but I can be persistently stupid at times. My next disaster was a MOOG milling machine. It used a Bridgeport base and didn’t have leadscrews. It was entirely controlled by hydraulics. Movement was controlled by thin plates that moved with the machine slides with accurate holes located at every inch. Pins about 0.187" (5mm) would engage the proper hole and then another plate with holes spaced at 0.200" would come into play, and the last 0.200" relied on a single turn of a lead screw. The machine finally arrived at a position within a 0.001" of accuracy. I didn’t realize it when I bought it, but I was horrified to find that this mother worked like a player piano. The one-inch wide paper tape wasn’t read with switching devices like other machines. It actually was more like a valve that allowed or prevented air to get to cylinders that controlled hydraulic valves. When it read a block of tape (around 10 lines of holes of 8 holes each) the SOB sounded like a steam engine. I chalked that one off to having more balls than brains; however, we actually made more parts with it than we did with the Deadlund.

It should also be noted that I’m sure that these early NC machines were the best that could be designed with what was available, and the solutions that they came up with were quite ingenious at the time. I’m looking back at it from a slightly humorous position and in no way infer that the designers of that era weren’t up to the task. They just didn’t have the tools to work with that we do today.

The course is set

At this time, NC machines could only cut straight paths, and as soon as the electronics were available to store just a small amount of memory the new rage became “look-ahead” control systems. This meant the cutting tools wouldn’t create machining problems when they hesitated as the next block of information was read. Stepper motors were used for a short period to drive the lead screws; however, within a few short years the entire industry switched to DC motors. Encoders or resolvers were used to keep track of position. The DC motors controlled by fast computers and working in unison with accurate ball lead screws created a system that was very close to where we are today; however, they were slower and very expensive. Today, servo drives use AC motors controlled by varying the frequency to the windings, eliminating the brushes needed with DC motors. The latest innovation is linear motors that can move machine slides at incredible speeds.

A new way of thinking

The marvelous part of the CNC revolution wasn’t just the fact that it was eliminating workers from sometimes very strenuous and boring jobs; it was that there was finally a method of cranking these handles in unison to do things that the best machinist in the world couldn’t accomplish. By moving screws on the X- and Y-axes in unison, you could machine tapers, circles and, in fact, any shape you wanted. This allowed engineers to design parts with the shapes that they wanted, not just shapes that were possible to machine using the old methods. Machines that cost thousands of dollars suddenly became scrap iron. These new CNC machines didn’t care if they were cutting a complex shape or a straight line. Whether the tolerance was tight or not the machine was always “right on,” and the tools determined the tolerances.

Ball lead screws—the missing ingredient

The lead screws used on these machines should be mentioned. They are the interface between the computers and the mechanics. The problem of backlash was solved with “ball lead screws.” These screws have re-circulating balls that roll in a groove ground into a shaft at a pitch of two tenths of an inch. The pitch on these screws has increased over the years to achieve speeds over 1000 inches (25 meters) per minute. At a pitch of .200² (5mm), a lead screw would have to turn at 5000 RPM to accomplish this speed, which is why ball lead screws have as high as one inch in pitch. Even more amazing was the fact that they improved the accuracy as they increased the pitch. You can make a .0001² (.0025mm) correction on a good CNC lathe. Think about that. A slide will accelerate to a speed of over 1000 inches a minute in less than a second, move a short distance and decelerate, stop and still be accurate to one ten thousandth of an inch. The ball screws must be very precise, because a lead screw would be useless if it had any backlash (the amount you have to rotate a lead screw before the slide moves).

Ball lead screws are very difficult to make, which makes them quite expensive—several thousand dollars for each axis. The people who solved the lead screw problem should be commended as much as the electronic geniuses who came up with the computer controls. At Sherline, we have CNC machines that have been running over ten years and still don’t have any noticeable backlash.

Carbide insert tooling changed the entire machine tool industry

At the same time, carbide insert tooling became available and took the market over like a storm. I don’t think I could have ever convinced a machinist in the fifties that some day he would be taking 0.300" cuts on cold rolled steel at a cutting speed around 400 to 600 fpm (200 meters/min) using a 40 hp lathe at 0.020" (.5mm) feed rate for each revolution with little carbide tools made using powdered metal technology and held in place with little screws and still be able to get marvelous finishes on gummy old cold rolled at the same time. They do, and we at Sherline do all these things that give our customers a lot of bang for the buck. The consumers of products that manufacture using this technology benefit as much as the manufactures that use them.

Because lathes could also produce these types of moves, the large and expensive form tools were on there way out. This may not seem significant, but by generating rather than forming shapes, these shapes could be far more precise, and at the same time machines didn’t have to be so massive to prevent tools from chattering. Hand scraped ways were replaced by frictionless, ingenious slides that lasted for years with little maintenance. Because there is always the possibility of a crash, machines are no longer built where the headstock is an integral part of the base casting, and in most cases they can be realigned if one of these disastrous events should happen.

Why I love CNC robots

In closing this section, I firmly believe that these machines that we call CNC are the robots of the future and I truly love them. They have allowed me, Joe Martin the designer, to design the parts that I’ve always wanted to design without dumping my problems on Joe Martin the machinist, who must produce parts for Joe Martin the businessman, who can supply you, the customer, a fairly priced quality product and at the same time allow Joe Martin the owner a reasonable profit to buy more of these marvelous CNC machines, of course. And so it goes.

Even though this doesn’t do the subject justice I thought you might find that interesting. It’s always wise to see at least a brief history of a subject before becoming part of it, even if it’s only statistical.

Here is something I wrote in my book that’s available online that you may find interesting.  See http://sherline.com/business.htm.

“THE NEW MANAGERS

CNC machines allow a smart worker to produce more work than ever. Rather than eliminating the need for intelligent workers, these machines require organizational skills that few managers have. The machines they control are very complex, and the employees who can control these machines are equally as valuable to a company as that of standard managers. In the past managers were considered people managers. The managers who control these machines are robot managers. When you consider how important these machines have become to the quality and efficiency of manufacturing a product, the group of workers that controls these machines will soon be equal to the managing staff of any company in prestige and wages. Today’s management still hasn’t grasped this concept, but soon they will be forced to accept this condition when they find their million dollar machines operating at half speed.”

This CNC class is open to those willing to work hard

In order to make the following instructions more interesting for me to write and you to read I’m approaching the teaching of CNC programming the same as I would as if I were teaching a small class of students. The students who attend these specialized classes later in life have various reasons and expectations for being there, and I’m trying to address the whole class as I write. When I take off on a tangent I’m addressing individual students with a different background who I visualize sitting in the class and answering a question that I believe may be asked in a similar class, so please bear with me. I don’t want any of my students left behind.

Enjoy the flight

In many of the coming examples I also describe the movement of the spindle as an aircraft that you’re riding in. This may seem “far out there,” but CNC milling is a 3D world, and if you try to describe these movements in the movement of the table slides you’ll soon not know whether you are coming or going. You have to visualize the work staying still while the cutter moves. Again, bear with me and enjoy the flight.

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. From their own statistics you would think manufacturers would have attempted to teach in a different manner, but they don’t. The products get more complex, making the instructions more complex, and the poor consumers of these products are at a loss. I don’t teach using these methods because they obviously don’t work. With my instruction you won’t be sure if you’re reading a novel or an instruction manual, but I’m sure you’ll be able to program and make a part when you get to the end.

The first instructions I completely wrote for my tools (I had written instructions about radio control equipment and rules for RC events in the past) were how to cut a screw thread using a rather crude device I designed (but which works well) for a Sherline lathe. I was surprised how few calls on how to use it came in after I sold my first 200, because it is a bit of a complicated thing to do. I then started to wonder if anyone was using it, and you’ll never know how relieved I was when a customer came in with a bunch of parts that he made with threads on them.

I knew I was on to something and have always written in this style ever since because it works. It had to work because at that time I was the only one at my company who could answer questions of this type, and I didn’t have the time. The fact that I’m a self taught person probably has something to do with it. I even went on to write a couple of books in this style that were well received. 

A new challenge

I remember getting a call from Sears about my folksy style of writing that didn’t follow Sears’ instruction guidelines about the screw cutting attachment. I asked him how many calls they had received about how to cut threads using it. He answered, “None.” I asked him who there could answer a technical question of this type. He answered, “Nobody.” I said, “With this being the case, don’t you think you should leave well enough alone?” I never heard from him again. Right now, I’m looking at these instructions as one of the biggest challenges I’ve ever taken on as an author, and I don’t plan to fail. The average instruction manual written on this subject is two to three hundred pages of very technical reading. You’ll never crack a smile reading one of these manuals. I’ll do it in less than fifty.

The only students I hired who learned CNC had good teachers, not good training manuals.  In fact, I can’t think of any employee in the last 30 years that I’ve ever hired who learned CNC programming and how to run these complex machines on his own. You will! I had to learn on my own because I was so broke after I bought my first NC I 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.

Sherline customers want to build components

I saw the customer who was going to read these instructions as a person who wasn't particularly interested in computers or gadgets and was only interested in making parts. I believed they were curious about CNC and wanted to learn about it without spending too much money. They probably haven't tried to learn how to do something this complicated in the last 20 years. Remember that CNC is a new way of doing and thinking about the machining process, and I believe I’ll help get your brain in tune with what you are about to learn with my ramblings.

Learning while you work

A student of this class could be already working at the trade. Words of advice for this group: You can’t afford to have idle thoughts as you load parts on machines that other people set up and wrote the programs for unless you are satisfied to load parts for the rest of your life.

First study the mechanical part of the setup; things like how the part is held and the type of cutting tools used and how long they last. You have to show some initiative and start analyzing the program you are running and ask intelligent questions. Notice, I said intelligent questions. Bosses are usually smarter than you think they are, and they easily know when some when clown is pulling their chain. Don’t ever make suggestions unless you are sure you are right. A better way to make a suggestion of this type is to ask them just why the job is set up or run the way it is rather than your way. That way you’re not threatening them with your question, and they’ll appreciate a chance to teach you if you are wrong. If you find out you were wrong, it gives you a way out by saying that you were sure that they must have had a good reason. It wouldn’t hurt to let that rule work its way into your personal life.

When you start studying their programs, you’ll find them written like a story. Just like a book, the better the author, the easier the program is to read. Each tool used will have its own chapter. (In the real world of machining you’ll run few machines without automatic tool changers.) Study these chapters one at a time and watch what the machine does as the program advances. In case you didn’t realize it, I’m also instructing all you hobbyist out there on how to organize your programs and setups. Plan them like someone else is going to run the job and pick apart your own work. If you don’t, you might find yourself trying to machine your vise off the table.

Getting you into the learning mode

I also felt that people of this type would want to read something about what they are in store for before they started. I wanted my customers to understand just how difficult CNC programming can be to learn at the start and just how interesting it can be at the same time. In other words, I felt “Joe home machinist” doesn't stand a chance unless he's inspired to do so, and in my own way I’m trying right now to inspire you to learn how to program and use these marvelous new CNC machines. I know how easy it is for you to 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. You are not operators of these marvelous machines; you are masters telling your robot what to do, and you, the controller, have unlimited choices to make. I want to get this concept through to that average customer I mentioned, yet I know that only one out of five professional machinists I know seems to really understand this point.

I’m going to be a student in my own class

I was shocked at just how much I had forgotten about the process of CNC programming. I probably know as much as anybody of what you can do with CNC machines, because I own at least twenty modern machining centers, yet I haven’t really written any code in fifteen years. After thinking about it for a couple of days while unsuccessfully attempting to write a simple program I decided this is a good thing. I also decided that I’d learn this from the Linux site on my own and not use the books that were available to me. I believed that if I wrote the instructions as I learned how to program EMC myself I’d write better instructions; after all, all you have to be is one page ahead of your students to teach. Just joking, teachers.

Something for nothing

Sherline Products Inc. is not charging you for this EMC program, and it is free because of work done by NIST (National Institute of Science and Technology), a government funded organization. The EMC (Enhanced Machine Controller) was written by the NIST and is a very sophisticated program. We all now have the benefit of millions of dollars of programming along with the source code, if needed, simply by asking.

We all owe thanks to the EMC group

At the time this program was written it was thought that only very advanced programmers and scientists would be using a program such as this, and the average person stood little chance of making it functional. Fortunately for us, a lot of very smart people before us, donating their time, started developing a programming interface that allowed both businesses and hobbyists to take advantage of what they had done without being engineers. I’m very pleased with what they have done. This group still works together through the Internet, and help is available through Internet chat groups. Many people have donated much of their time to make this system “user friendly.”

The EMC program operates under the Linux operating system, which is also a free system, and it would be wise to operate it from a dedicated computer for this task. A dual boot system can lead to problems, because Microsoft code has been purposely written to be the dominant control of your computer whether you want it or not. I like the Linux concept of people working together where all have the benefit of any single person’s work. For example, these instructions will have a Sherline link placed on the EMC for all to read whether they are Sherline customers or not. It will be my donation towards a 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.  http://www.linuxCNC.org/

This is going to be easy if you do it my way

The Linux operating system is similar to use to all others, and I’ll try and mention things that are a little different in using the EMC program. To start with, you don’t have to double click to enter a program, so a single click on the big red “S” (Sherline, not Superman) with the file name “inch_freq” underneath, and after a few seconds you’ll get the graphical interface to the EMC. Well, that was easy. Now, after BS-ing you to death on how hard this was to do I’m going to show you how easy this can be, but only if you do it my way.

Computers have the patience of a saint

If you’ve had little computer experience the first thing you will learn is that computers have the patience of a saint. If computers were more human they would probably like to toss their operators out the window as much as frustrated operators want to do the same to them. The only way you can keep a computer from giving you an error message is to not give it errors. The tricky part is computers don’t always tell you the error to fix or how to fix it. Computers just tell you that there is an error of a certain type. This can become maddening, and you have to know when to take a break and walk away. Things of this nature are the worst when, for the sake of your own sanity, they should be the best. In many ways, learning programming is similar to learning machining. You can’t take short cuts. If you find yourself going in the wrong direction, back up immediately.

Learn machining first

If you know little about machining and little about computers I’d suggest you first concentrate on learning about machining. How can you expect a machine tool and a computer to carry out your commands if you don’t know the commands to give? Above all, don’t start with a project so complex you don’t stand a chance in hell of succeeding.  Let each simple problem solved have its own rewards in knowing you just traveled another block further down the CNC machining super highway, route EMC.

NOTE: I have written a book called Tabletop Machining that is an introduction to metalworking at the small end of the size scale. Details can be found at www.sherline.com/bookplug.htm. If you are new to machining, you will find the information in this book quite helpful.

You will be learning the CNC language of the robot world

The standard “G” code method of programming is to simply replace the manual inputs into a machine (cranking the handles) with the commands that have become industry standards. This is the method you should learn before learning any other method of programming. It is the basic way that CNC machines “talk” to other CNC machines. Even if a simpler system were available today I still wouldn’t teach it. It would be similar to teaching a language that few citizens of the world spoke. Programs written using g-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. Each program has to work with other programs, and each program has its own set of complex rules. If you think you can learn these programs easier than you can solve a couple of trig problems you’re in store for a rude awakening; however, if you already know how to use 3D CAD programs you could quickly find these programs very useful. It should also be stated that it is the only way available to create contoured machined shapes.

What it costs in the industrial world

The basic method that these programs work together in the industrial world and the cost of these programs is: 1) The part is designed using a modeling program ($5000 to $10,000), 2) The modeling program is converted to a CNC program (another $5000 to $6,000) and 3) the resulting code is run on a CNC machine starting at ($25,000) that makes the part. The people who can operate these systems are carefully chosen, trained and well paid. The fact is that any business has no choice except to use the program they purchased, because the programs cost so much and are so very necessary to remain competitive in today’s world. They have to spend a great deal of money to accomplish this, while the hobbyist has a choice.

Today’s low-cost programs were once complex, expensive programs

The business world understands how complex it is to implement these procedures; the hobbyist doesn’t. Because the hobbyist may be purchasing a program that cost thousands of dollars just a few short years ago for a few hundred dollars, the programs themselves haven’t become less complicated. They only cost less! In your mind you may be having visions of complex shapes being machined with little effort on your part while your two thousand-dollar investment turns out parts that the old masters of the machine trades would envy. Well my friend it’s possible, but it’s time to come down to earth and again think about the complexities of doing so.

Cutter compensation—what makes CNC work in a machining environment

I could have sneaked out the back door and only wrote instructions for a couple of simple moves without cutter compensation and let it go at that; but deep down inside, I’d have known I was cheating you out of the real benefits of CNC. I believed that if I started teaching you to use this marvelous programming tool right at the very start it will soon be second nature, and our class will leap-frog ahead of our competition with those thick boring books being taught by instructors I wouldn’t let near the least expensive CNC machine in my shop.

If you take the effort to learn this method of programming at the start along with a little simple trig, you’ll find it well worth the effort. Cutter offsets are the way you control size with modern CNC machines. When you start making more complex parts and you don’t use cutter comp you’ll have to change the basic numbers of your programs to make a part on size. Sounds simple enough until you find that every time you correct a number here 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. In a sense I’m also stating to you that you will have to learn programming the same way as I’m about to, and at this time I’m only a couple of pages ahead of you. I am certain that if I sat by the phone and answered questions twenty-four hours a day, and I don’t plan to, I couldn’t help those who aren’t willing to put forth the effort it takes on their own to learn to work with these marvelous tools.

Route EMC

This road that you are beginning to travel can become one of the most interesting roads you have every traveled; however, you must take the time to gather the facts that can make a trip so interesting. Instead of seeing great ancient cites on this road we’ll be gaining the knowledge that will make our next stop even more interesting and more complex. We’ll study a little and then apply these rules to your machine. We will first make simple moves that become more and more complex and at the same time more interesting as we travel on. Eventually we will reach Martinsville, a city on this road, where you will have so many choices as to the direction to travel that you’ll be leaving me and heading out on your own to design and build things that you never thought possible in the past. The rules and facts that you will learn on this road will allow you to have a machine at your control that home machinists a few short years ago couldn’t dream of. Take the time to enjoy this trip because you’re on a road with no end if you have set your goals correctly.

You may want to consider a CAD program in the future

I’m going to close this section off by inserting something I wrote about learning and using AutoCad®. The ease with which many of the programming problems can be solved has to be mentioned at this time; however, I wouldn’t recommend dropping what you are doing. From what I understand there are several excellent programs available at very reasonable cost, but I don’t want to recommend any particular program.

The following paragraph is from my book Tabletop Machining. It covers some of my comments about learning to use a CAD program.

“Learning AutoCAD®

The first task I took on to learn the program was to lay out and design a set of bevel gears that could be cut on a Sherline mill using a rotary table mounted on an angle plate. By drawing the cross sectional view accurately, the angles needed to cut this gear could be taken directly off the drawing without using a trig table or a calculator. I was beginning to see the light.

I’m getting pretty good at using the program now and it has put a lot of the fun back in designing for me. Looking over my partner Carl’s shoulder at an assembly designed by computer was of no help for me, and I would need a standard full size or larger layout to design with. I’ve since found that doing the design totally myself, it has become the perfect way for me to work. I love the program. It has become the perfect program for a designer and manufacturer like myself and has made me more productive than ever.

I’m fascinated with the program because it does a drawing without errors when used properly. The program eliminates much of the boredom of adding and subtracting numbers as you go. Accuracy isn’t attained by the precision of your lines but rather by the accuracy of the information the program is given. Angles are not derived from a protractor and using divider points but from calculations by a computer to as many decimal places as needed.

I learned drafting in high school back in the fifty’s. My problem was I was a “slob” when it came to drafting a pretty drawing. My numbers and views would be correct, but my lettering and lines weren’t neat enough. Things have changed now with the aid of this program and my lettering is just as good as the best. I can no longer spill gobs of ink on an almost completed drawing and have to start over. I can change my mind as much as I want without irritating anyone. I’m a happy man.”


Operating Instructions

Part 1

Instructions: Mill vs. Lathe

These instructions were written primarily for using the CNC system with a mill. A CNC-ready Sherline lathe can also be controlled using the same computer and driver system. You would simply plug the crosslide stepper motor to the X-axis cable and the leadscrew stepper motor to the Y- or Z-axis cable. Writing a program for the lathe is a little different in that you must remember that when you program a distance for the X-axis travel, the part diameter will be reduced by twice that amount. This is because you are taking that dimension off the radius of the part, which is one half of the diameter. Other than that, a little logic on your part should be able to accommodate the differences between the spinning cutting tool/moving part on a mill and a spinning part/moving cutting tool on a lathe. Because of the extra mass of a spinning chuck and part, extra caution should be taken to make sure your program is not going to cause any interference between crosslide or toolpost and the spinning chuck/part once it is running.

System Components and Connections

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 in or unplugging a stepper motor. Improperly connecting or disconnecting a motor can damage it.

2.      Before turning on the computer and booting up EMC, make sure the power switch for the stepper motors on the side of the computer (or on the 8760 driver box) is in the “OFF” position. After EMC is fully loaded it is then OK to turn on power to the stepper motors.

3.      Do not turn power on to the stepper motors unless EMC is already running. Controls within 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.

4.      If operating the system outside the USA, make sure the 115/230 Volt power switches on the computer and driver power supply are in the correct position before turning on. The spindle motor will automatically adapt to any current from 100 to 240 VAC, so no transformer or switching is needed.

System components:

1) 1-5/8" manual handwheel

2) Z-axis stepper motor

3) Stepper motor mount

4) Sherline vertical mill with drill chuck, headstock spacer block, hex adjustment keys and spindle bar

5) Backup Linux/EMC installation CD, Sherline instructions CD and Vector32 CAD program CD

6) Y-axis stepper motor

7) X-axis stepper motor

8) Cable for optional A-axis connection

9) Computer with CD-ROM and Floppy drives, keyboard and mouse

10) On/Off switch for stepper motor power supply

 

Connections on back of your computer:

1) Keyboard connector cable (purple)

2) Mouse connector cable (green)

3) Computer power switch

4) Connector from driver board to parallel printer port

5) Power cord

6) Connect your monitor here (blue)

7) On/Off switch for driver power supply

8) Output cables to stepper motors for A-, Z-, Y- and X-axes

Assembling your system

Getting your system up and running is a simple task. It consists of assembling your mill and connecting it to the computer as follows:

Mill

Unpack and assemble your machine according to the instructions included in the Sherline Assembly and Instruction Guide packed with the mill.

Computer connections and starting up

Unpack the computer and enclosed components. Connect the stepper motor cables leading from the back of the computer to each of the three stepper motors. A fourth cable is unused unless you have purchased an optional rotary table that can be connected here as a 4th (A) axis. Plug the purple keyboard cable (Ref. #1 in the previous photo) and the green mouse cable (2) into their receptacles. Plug your monitor to the blue monitor receptacle (6). If not already connected, plug the free end of the 25-pin parallel cable in to the printer port (4). Insert the female end of the power cord into its receptacle (5) in the computer and plug the male end into a properly grounded wall socket or surge protected power strip. Turn on the computer and monitor but leave the power switch to the stepper motors in the “OFF” position for now. Wait until EMC starts up before turning on power to the stepper motors with the toggle switch on the left side of the computer case.

NOTE: If you start EMC and run a program and the screen shows the program is running but the stepper motors are not moving, make sure the Parallel cable is plugged in as noted above.

Opening the instructions file on the computer

If you are not familiar with Linux, you will find the desktop that opens when your computer starts up to be comfortingly similar to the Windows® or Mac® desktop you are used to. On the desktop you will see icons for several files. Using your mouse, click on the file labeled “Sherline EMC Instructions” to open it. The instructions can also be found on the enclosed CD as well as at Sherline’s web site at www.sherline.com/CNCinstructions.htm. Please read all the instructions before attempting to use the EMC program to run your mill. CNC machining is a complicated process, and you will be directed at the proper time to run a program on the machine once you have gained the knowledge you need to do so.

EMC—Still the latest and greatest

I chose the EMC program to work with because: 1) EMC uses coding standards that are used in the modern machine tool world, 2) You will not be dealing with an outdated programming system, 3) EMC can deal with the cutter compensation (cutter comp) that is needed to make complex parts in an efficient manner, 4) The cost saved by not having to pay for this marvelous programming system will allow you to purchase a separate dedicated computer to drive your mill and 5) There’s great bunch of smart people working on EMC to constantly improve the system and make it easier to use in the future and remain current.

Basic operation of the computer and file navigation

Booting up

Before turning on the computer, make sure the 115V/230V switches on the back of the computer and on the side of the stepper motor power supply inside the computer are set to the proper voltage for your local electrical current. (Default setting is 115 VAC.) Also, make sure the ON/OFF switch for the stepper motor power supply on the left side of the computer is in the “OFF” (down) position. Once the EMC program is fully up and running, power to the stepper motors can be turned on. Also, do not turn power on to the stepper motors unless EMC is already running. Controls within 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 EMC Program—Login and Password

When starting up, the computer will boot up without asking you to log in. If you log out of the desktop and log back in and get a login screen, enter “sherline” for the login (in all lower case letters) and “sherline” for the password.* After completing the login entries, left click the [Go] button with your mouse, and the desktop will appear.

*NOTE: For earlier systems using BDI version 2.18 the login is the word “root” and the password is left blank. On versions 4.05 and higher a Sherline account is also available, so you should enter “sherline” instead of “root.”

To open EMC, click on the “Sherline CNC (inch)” or “Sherline CNC (metric)” icon on your desktop. If they don’t appear there, move your cursor to the lower left corner of the screen and click on the icon with the large “K” in it. Scroll through the menu to where it says “EMC.” Choose either the inch or metric version of EMC and click on your choice. This will open the proper version of EMC, and you are ready to get started. (You can click on either icon and drag it to the desktop to create a shortcut for future use if one is not there already.)

Instruction files

The instructions for the use of your system are preloaded on the computer. To find them, click on the “S” logo on the desktop labeled “Sherline EMC Instructions” to open the HTML version of the instructions. There is also a folder labeled “Instructions” that contains the PDF and HTML versions in both full length and the shorter “print” versions. The “print” version contains only the pages relating to learning g-code in case you want to print it out and refer to a hard copy when working with the examples. The files are also on the backup CD that came with your system. Included along with the PDF and HTML versions is a MS Word (.doc) version should you wish to open it on a Windows® machine that has Microsoft Word® installed. The most current version of the instructions can always be found on the Internet at www.sherline.com/CNCinstructions.htm. PDF and HTML files can be opened in Linux or Windows.

Shutting down the computer when done

To properly shut down your computer after you have closed EMC click on the “K” icon in the lower left of the screen and choose the appropriate command from the menu that pops up. (You can also right click on the screen to bring up this menu.) You can choose to log off, restart or shut down.

Emergency stops

If you see a physical “crash” is about to occur, you can use the mouse and the [Feedhold] command to stop the program, remove the obstacle and then use [Continue] to continue with the program, but that can take too much time in a panic situation. The fastest way to stop the stepper motors is to turn the power switch on the side of the computer to “off.” The spindle will continue to run, and the machine will have to be re-homed and the program restarted, but turning off power to the stepper motors while they are running will not cause damage. Running a slide until it hits a hard stop should not cause any physical damage either, but power to the motor should be turned off either by stopping the program or turning the stepper motor power supply switch to OFF as soon as possible to prevent possible overheating of the stalled motor.

A fast way to kill power to everything at once in an emergency is to plug all your power cords into a single power strip that is mounted within easy reach near the machine. Hitting the ON/OFF switch on the power strip kills power to the computer, spindle motor and stepper motors all at the same time. The computer will have to be restarted and the machine returned to the home position, but it will not damage the computer or EMC to turn off power to it when EMC is running, and it might save a valuable part that is about to be destroyed.

Transferring G-code files from another computer

1. On the computer you use to generate your G-code, save your G-code text file to a floppy or CD in Plain Text (.txt) file format. Program files created in EMC will automatically be saved with the .ngc extension. Either can be read by EMC.

2. Insert the floppy disk or CD containing your file into the appropriate drive on your Sherline Linux computer.

3. On the desktop, click on the “CD” or “Floppy” icon of the drive where your source disk is located to open a window showing the contents of that drive.

4. On the desktop, click on the “Home” icon and then open the folder called “gcode.”

5. Click/drag the new file from the floppy or CD window and drop it into the “gcode” window.

The Desktop with two windows open for transferring files.

Above is the desktop with both the “gcode” folder window and the floppy drive window open. Using the mouse, put the cursor on the file you wish to transfer. Click the left mouse button and keep it held down and the file will be highlighted. (If you just click on the file and release the button, the file will open.) While still holding the button down, move the mouse to drag the icon of the file from one folder window to the other and then release the mouse button. A dialog box will appear offering you a choice of moving or copying the file to the new folder. Use the [Copy Here] command. A copy of the file will now be added to the target folder and the original will remain in the source folder. 

Saving a file created or modified in EMC to your “gcode” folder

1. On the top menu bar, make sure the “Editor” box is checked (filled with color).

2. If the editor window is not displayed as the main window, click on that window to cycle through the checked functions until the window showing the lines of G-code is displayed.

3. The main window will now have a small menu bar above it where you can select “File > Save As.” When you do, a window will open.

4. The default directory to save programs should be the “g-code” folder. If it is not, in the file saving window click on the file icon in the upper right corner of the window and navigate to “Desktop > Home > Sherline > gcode” to select the gcode folder.

5. In the “Name” bar type in a file name and then click the [Save] button.

You can also save a file directly to a floppy disk rather than to the “gcode” folder by navigating to the floppy drive instead of the “gcode” folder in step 4 above and then naming and saving as in step 5. Remember to “Unmount” the floppy drive before removing the floppy disk to complete the saving process. (To unmount the drive, right click on the floppy drive icon on the desktop and select “Unmount” from the menu that appears. Do not remove the floppy until the light on the drive goes out.)

Transferring a file from your “gcode” folder to a floppy

1. On the desktop, click on the “HOME” icon and then the “gcode” folder to open a window showing the contents of the “gcode” folder.

2. On the desktop, click on the icon for your floppy drive. This mounts the drive and opens a window showing the contents.

3. Click and drag the file to be saved from the “gcode” window to the floppy drive window. When the mouse button is released a small menu will appear. Select “Copy Here”. Finally, click the “X” in the upper right corner of the floppy drive window to close it.

4. The floppy icon on the screen will have a small green arrow in the lower right corner. This means the drive is mounted. To complete the saving process the drive must be unmounted. Right click on the floppy icon and select “Unmount” from the menu. Do not remove the floppy disk from the drive until the light on the drive goes out indicating the copying process is completed.

NOTE: In this version of Linux you can name files whatever you want on your computer, but they cannot be copied to a floppy disk if they have a file name longer than eight characters.

What’s in the “gcode” folder?

When you open the folder called “gcode” there are already several programs we have pre-loaded that you can run or modify. Here is what they are called and what they do:

0-new.ngc—A blank program ready for you to open and rename to create your own programs

TheGreatRace.ngc—A triangular aircraft race course used as an example in the instruction manual. Note: This is the only example given in the Sherline instructions that you don’t have to type in yourself because it is lengthy for what it does.

The following programs are written by the EMC group as examples of different types of programming techniques and haven’t been fully tested by Sherline. Ray Henry provided the explanations.

3D_Chips.ngc—This little penguin is the EMC mascot. It is written using metric dimension but can be run on any mill. It is a bit too large to run directly on the Sherline mill but is a great sample of contouring that will go quite a ways in foam.

3dtest.ngc—Runs X, Y and Z axes to draw circles in several planes (on-screen use only, not for cutting an actual part). Run this from near the center of each axis and it draws a circle and the letters of the plane on which the circle lies. This can be handy when you change the angle of view of the plotter, because it will show if you are looking through an axis because the lettering will be backwards or upside down.

bbxy.ngc— (Metric) This program moves the cutter in about a four-inch circle in one direction and then the other. There is an m00 between the direction change so you need to press [Resume] or <s> on the keyboard

bbxz.ngc— bbxz.ngc is the same as bbxy above except that it makes
circles in other planes.

bbyz.ngc—bbyz.ngc is the same as bbxy and bbxz above except that it makes
circles in other planes.

cds.ngc—Circle Diamond Square (cds) is the original proof that the EMC
interpreter could run a milling machine. It is also a bit large for the Sherline mill but works great in the backplot mode. It allows you to change views and look at the various parts of a milled cube.

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.ngc—Runs X, Y and Z axes to create a slight domed surface.

isd.ngc—As well as nist.ngc and nist2.ngc are variations of a router program that cuts a NIST (National Institute of Standards and Technology) logo. There is an error near the end of the code in one of them. See if you can find it. These take a while to complete.

Opening the new file in EMC

1. Open EMC.

2. Click the [AUTO] tab along upper menu bar.

3. Click the [OPEN] tab on lower menu bar.

4. Highlight the file you want to open by clicking on it.

5. Click the [OPEN] box.

Installing a CD writer (CD-RW)

As of August, 2006, a CD-RW (Read/Write) drive is installed as standard equipment in Sherline CNC computers in place of the earlier CD-ROM (Read Only Memory). For those reinstalling Linux/EMC on their Sherline computer and for customers who are using their own computer with a CD writer and installing Linux/EMC themselves, note the following new instructions:

When you right click on CD-RW icon, unlike in previous versions where a CD-ROM was used, the menu has changed. Instead of Eject it now says Actions, and after that there are two options to choose from: Eject or Create Data CD with K3b.

Added to the K-menu is Multimedia > CD & DVD Burning (K3b). This application allows you to burn CD’s (or DVD’s if you have a DVD writer installed.)

How to use K3b to write a g-code file to a CD

After burning is completed there is no need to save any files, so click Discard the message after burning is finished.

The K3b program offers a number of additional options that you may explore on your own.

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 above 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. The power switch for the computer is located on the front of the computer. The driver power switch is located on the left side of the computer as indicated in the above photo. Up is on, and down is off.

When the computer is turned on, text will start scrolling on your monitor and the desktop will appear. This will allow you to have access to various Linux programs; however, the only program that Sherline will be using is the EMC metric or inch programs. Choose the program that represents the leadscrews that are installed in your Sherline machine. Unlike Windows, a single click on the appropriate icon will load EMC.  A photo of the CNC mill will appear and then the EMC program will open. Unlike earlier versions you will not be asked for a login or password. (NOTE: If you log out and log back in you will be asked for a login and password. In machines with EMC installed by Sherline the login will be “sherline” and the password is also “sherline.” If you have done the installation on your own machine, the login and password will be whatever you set up in the initial installation, so do not forget what you chose.)

You can also find these programs by clicking on “K” icon in the lower left corner of the screen, EMC > Sherline CNC (inch) or Sherline CNC (metric). This will initiate the start of the Sherline EMC system which will take less than a minute.

I had Ray Henry put together the interface specifically for the Sherline CNC. He also wrote much of “The Sherline Graphical Interface” section of the instructions. Many of the features of the standard EMC program were removed for the Sherline interface because they didn’t apply for a mill of this size and type to keep things as simple as possible. Sherline machines do not have limit or home switches and do not have direct control of spindle speeds and such. It is a general motion interface to the EMC. With it you can jog any axis. You can set coordinate systems and tools. You can verify and view the spindle path and motion in a built in program called “Backplot” and dry-run a program before running the machine. The panel is laid out in a sensible manner and is easy to understand.

 

FIGURE 1—The control panel

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. If more than one pop-in is active (button shown as red) you can “toggle” between these pop-ins by right clicking anywhere within the pop-in screen with your mouse.

Below the menu line is a line of control buttons. These are the primary control buttons for the interface. Using these buttons you can change mode from [MANUAL] [AUTO] [MDI] (manual data input). You can also use [FEEDHOLD] or [ABORT] to stop or abort a programmed move. When you press the [FEEDHOLD] button it changes color and becomes a [CONTINUE] button.  It toggles between running and pausing. Feedhold has the advantage of being able to restart the program from where you stopped it. When all else fails press a software E-Stop—the button in the upper right labeled [ESTOP PUSH].

There are two columns below the control line. The left side of the screen shows axis position, feed rate override, and any messages that are sent by the EMC to the operator. You can add things like current tool number and length, type of position shown, and offsets in effect by looking under the <View> menu.

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—The screen with BACKPLOT displayed

The Backplot Screen

If you compare the second screen shot with the first you can see that we are in now Auto mode, a program has been run, and the tool path is being displayed using Backplot.

Notice that the display position numbers have changed color. When you start first load the EMC program, the slide location position will be displayed in gold. This means that a homing routine has not been done yet. Once an axis has been homed, the numbers turn dark green.

To the upper right of the plotting screen is a small window with a pyramid figure that displays the angle from which you are viewing the tool path. When the EMC is first started, the default view in the Backplot mode is oriented at (X-27°, Y17°, Z30°, Zoom = 0).  These values can be changed by using the sliders underneath the pyramid to view your program from any angle and at various distances. While running your program in Backplot mode, keep these values in mind, as they will determine how the program is 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. Once in feedhold, the same actions will return you to the speed the machine was moving before the feedhold.

You can adjust feedrate override by grabbing the slider with your mouse and dragging it along the groove. You can also change feedrate a percent at a time by clicking in the slider’s groove. In auto mode you can also set feed override in 10% increments by pressing the top row of numbers on your keyboard. The number 1 will set feed rate override to 10 percent of programmed or jog speed.  The number 9 will set 90 percent.

NOTE: Do not enter a value higher than 100 for the Feed Override, as the program will stop and you will get the error message “axis 0* following error.” (*The number indicated could be 0, 1, 2 or 3 depending on the axis selected.)

Messages

The message display located under the axis positions is a sort of scratch pad for the EMC. If there are problems it will report them there. If you try to home or move an axis when the [ESTOP] button is pressed, you’ll get a message that says something about commanding motion when the EMC is not ready. If an axis faults out for something like falling behind, the message pad will show what happened.

If you want to remind yourself to change a tool for example, you can add a line of code to your program that will display in the message box. Example: (msg, change to tool #3 and press resume) will display “change to tool #3 and press resume” in the message box. The “msg,” comma included is the command to make this happen; without “msg,” the message wouldn’t be displayed in the message box.

To erase messages, simply click the message button at the top of the pad or hold down [Alt] and press [m].

Manual Mode

Manual mode shows a set of buttons along the bottom of the right-hand column. A green button labeled “ALL ZERO” has been added to designate the present position as the home position. I felt that a machine of this type would be simpler to operate if it didn’t use a machine home position. This button will zero out any offsets and will home all axes right where they are.

Axis Focus (Active)

Axis focus is important in manual mode. Notice that in Figure 1 above you can see a line or “groove” around the X-axis position display. This groove says that X is the active axis. It will be the target for jog moves made with the plus and minus jog buttons. You can change axis focus by clicking on any other axis display. You can also change axis focus in manual mode if you press its name key on your keyboard. Case is not important here. [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. Again, case is not important for keyboard jogs.

The two small buttons between the large jog buttons let you set which kind of jog you want. When you are in incremental mode, the distance buttons come alive. You can set a distance by pressing it with the mouse. You can toggle between distances by pressing [i] or [I] on the keyboard.

Incremental jog has an interesting and often unexpected effect. If you press the jog button while a jog is in progress, it will add the distance to the position it was at when the second jog command was issued. Two one-inch jog presses in close succession will not get you two inches of movement. You have to wait until the first movement is complete before jogging again.

Jog speed is displayed above the slider. It can be set using the slider, by clicking in the slider’s groove on the side you want it to move toward, or by clicking on the [Default] or [Rapid] buttons. This setting only affects the jog move while in manual mode. Once a jog move is initiated, jog speed has no effect on the jog. As an example of this, say you set jog mode to incremental and the increment to 1 inch. Once you press the [Jog] button it will travel that inch at the rate it started.

Keyboard Jogging

When the control is in manual mode you can also control the slides using the keyboard cursor control arrows. The slides will move in the direction the arrows point, and the Z-axis can be raised or lowered using the [Page Up] or [Page Down] keys. The speed the slides move at will be determined by the manual feed rate setting.

Yes, you can move the machine around in manual mode. You can even do some tolerable milling in manual mode, so long as you work a single axis at a time and set jog speed for the feedrate that your tool, machine, and material need, but the real heart of CNC machine tool work is the auto mode.

Auto Mode

Sherline’s auto mode displays the typical functions that people come to expect from the EMC. Along the top are a set of buttons which control what is happening in auto. Below 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. Press [Step] again to get the motion of the next block. Press [Resume] and the interpreter goes back to reading ahead and running the program. The combination of [Pause] and [Step] work a lot like single block mode on many controllers. The difference is that [Pause] does not let motion continue to the end of the current block.

Feedrate Override and Auto Mode

The number buttons along the top of the main keyboard will change feed rate whenever you are in auto mode. Pressing the gravé [`] gets you zero percent feed rate. One through zero gets you ten through 100 percent feed rate. These keys can be very handy as you approach a first cut. Move in quickly at 100 percent, throttle back to 10% and toggle between [Feedhold] and 10% using the keyboard’s pause key. When you are satisfied that you’ve got it right, hit the zero to the right of nine and go.

Verify

The [Verify] button runs the interpreter through the code without initiating any motion. If verify finds a problem it will stop the read near the problem block and put up some sort of message. Most of the time you will be able to figure out the problem with your program by reading the message given and looking in the program window at the highlighted line. Some of the messages are not real helpful. Sometimes you will need to read a line or two ahead of the highlight to see the problem. Occasionally the message will refer to something well ahead of the highlight line. This often happens if you forget to end your program with a %, m2, m30 or m60.

Restart

To the right of the program window is a space that will show a set of restart functions. These pop in whenever a program is aborted or an EStop happens while the interpreter is running or paused. You can also display or hide these using the view menu.

I’ve got to warn you that [Restart] can be risky. [Restart] reads down through the program to the restart line. While it does this it sets up its “world model” so that it can resume right where it stopped, but only if the tool is right where it was. Most of the time, when we abort or EStop it’s because something went wrong. Perhaps we broke a tool and want to change it. We switch to manual mode and raise the spindle, change tools, and assuming that we got the length the same, get ready to go on. If we return the tool to the same place where the abort was issued, the EMC will work perfectly.

It is possible to move the restart line back or ahead of where the abort happened. If you press the [Back] or [Ahead] buttons you will see a blue highlight that shows the relationship between the abort line and the one on which the EMC stopped. By thinking through what is happening at the time of the restart you can place the tool tip where it will resume work in an acceptable manner. You will need to think through things like tool offsets, barriers to motion along a diagonal line, and such before you press the [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. You can also write this list to the message box in any mode if you look under the info menu and select active g-codes. This listing can be very handy. I often forget to enter a g00 before I command a motion. If nothing happens I look down there to see if g80 is in effect. G80 stops any motion. If it’s there I remember to issue a block like g00 x0 y0 z0. In MDI you are entering text from the keyboard so none of the main keys work for commands to the running machine. [F1] will Estop the control.

Pop-in Editor

To edit a program that is already open, make sure the “Editor” button is active at the top of the screen. (Clicking on the box next to the word “Editor” will make it turn red, meaning it is active.) Clicking repeatedly on the work screen toggles between any functions that are active (box is red) across the top row. In the Editor window you can edit the g-code for your file. When you open this screen, you will see that a small menu bar opens above the screen with the usual editing functions to be found under “File,” “Edit,” etc. With these you can copy and paste within the program. The pop-in editor does not allow you to copy and paste between programs.

CAUTION! Be very careful when you highlight text when you are writing a program. If you accidentally hit any key while a line or lines is selected it will delete the selection. When this happens there is no “undo-oops-back” command. Using the “File > Save” command often is highly recommended.

The Editor feature is included because it has the ability to number and renumber lines in the way that the interpreter expects of a file. It will also allow you to cut and paste from one part of a file to another. You can save your changes and submit them to the EMC interpreter with the same menu click. You can work on a file in here for a while and then save and load if mini is in auto mode. If you have been running a file and find that you need to edit it, that file will be placed in the editor when you click on the editor button on the top menu.

The newer software has a menu listing for another Linux editor named “Kate.” Kate does allow for copying and pasting between programs. You can load several and even split the screen between them.  From the “K” menu in the lower left corner of the screen go to “EMC > G Code Editor.” When you start it and select “Open” you can find all your stored programs and use "File > Open" to open one. 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 another 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 EMC by selecting the program file after saving it with Kate.

Backplot

[Backplot] will show the tool path that can be viewed from a chosen direction. “3-D” is the default. Other choices and controls are displayed along the top and right side of the pop-in. If you are in the middle of a cut when you press one of these control buttons the machine will pause long enough to re-compute the view.

Along the right side of Backplot is the pop-in that you can display with the [SETUP] button. This will show a small graphic that tries to show the angle you are viewing the tool path from. Below it are a series of sliders that allow you to change the angle of view and the size of the plot. You can rotate the little position angle display with these. They take effect when you press the [Refresh] button. The [Reset] button removes all of the paths from the display and readies it for a new run of the program but retains your settings for that session.

Pop-in Tool

The tool page is pretty much like the others. You can set values here and they become effective when you press the [Enter] key*. You can’t change tool offsets while the program is running or when the program is paused. The [Add Tools] and [Remove Tools] buttons work on the bottom of the tool list. Once a new tool has been added, you can use it in a program with the usual commands.

*Always use the [Enter/Return] key at the right side of the normal alpha keyboard, not the [Enter] key at the bottom right of the numeric keypad.

Limit switches

I felt that limit switches would add an unnecessary cost to the system when using stepper motors with limited torque such as these. They have to be mounted in areas where they are exposed to chips, oil and coolant creating more problems than they eliminate. The Sherline mill is fitted with “Hard Stop” screws on the X and Y axes that limit travel. These stops are the heads of cap screws fitted to the table and base and positioned to stop a runaway axis without damage. If you make a programming error that would drive the table into a crash situation by over-traveling, the table will encounter these hard stops before damaging the leadscrews and nuts.

You could also locate a home position from these hard stops by stalling the stepper motors against them. Of course you should do this in manual mode and by bringing the table against the hard stop carefully in slow speed and "buzz" the motor against it. I personally would find a different way of locating a home position, using the dials on the handwheels for example, but it is an option for unusual situations

It should also be noted that the hard stop screw would have to be removed from the left underside of the table in order to have the full nine inches of advertised X-axis travel. With the stop screw in place travel is about 8.65".

An introduction to 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.

4) Dry run the program with the spindle well out of the way so it can’t possibly crash.

5) Accurately align the machine with the work so they work in unison when the program is run.

Push the button and have a cup of coffee while your little Sherline just works its butt off for you making good parts.

When you think about this, it has the same steps as to do it manually. Compare:

1) Make some special tooling to hold the special shape. With CNC you can hold raw stock in a vise and machine the shape you need.

2) We’d have to store the special tools in case we wanted to make another one.

3) You’ll make a lot of scrap with a manual machine if you don’t double check your work before making the first cut, and you will not have a computer to help you as you do with EMC.

4) No matter how you do it, you always have to line up the work to the machine.

5) Don’t put the coffee on yet because your real work has just begun while our boy with the CNC is pouring a second cup and making 7th part of ten pieces. (Oh, how I wish it could be this easy at the start!)

Using “Backplot” to check your program

1) To work with any existing programs we have to be in the [AUTO] mode. With power to the stepper motors turned off [Open] the existing program called “3dtest.ngc.” This file comes with EMC.

2) Open the [BACKPLOT] program that can be found on the upper line and a blank section will appear in the Pop-in section. The [Backplot] feature will allow you to visually check a program without actually running the stepper motors. Right clicking your mouse controls the program that is viewed in this section of the control panel. You can toggle between the editor and the backplot easily. We now have the perfect setup to learn CNC and it all fits on a single desktop. You can view and edit your program or view the moves the spindle will make while your program is running.

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. The line of the program that is highlighted in red in the lower area of the control panel is the line of code that is being processed by the control as the computer runs the program. Note that the EMC program is processing more than a single line of code at the same time; therefore, this line should only be considered "approximate."

How to make a file for our programs

It’s possible to create a new file and have them end up in the wrong folder never to be seen again, and if you use this method you will always have your new programs in the proper folder. If you are using a computer supplied by Sherline, you’ll find the file called “0-new.” The instructions in sections D) and E) below describe how to change “3dtest.ngc” to “0-new.” Since Sherline owners will have this file already provided for them, they can skip sections D) and E) when they come to them and go on to section

1) To create a new file or work with any existing programs remember you have to be in the [AUTO] mode. Notice that a new line of commands appears along the bottom in this mode. The [Open] button is located in the along this row. Note: the method I’m describing in A) to E) below is to set up your computer for future use and isn’t the necessary steps you’ll use in the future.

A) With power to the stepper motors turned off [Open] the existing program called “3dtest.ngc.”*

*This file comes with EMC. If you are using a computer supplied by Sherline, you should instead open the file called “0-new.” The instructions in sections D) and E) below describe how to change “3dtest.ngc” to “0-new.” Since Sherline owners will have this file already provided for them, they can skip sections D) and E) when they come to them and go on to section 2).

B) Go to the Pop-in [Editor] command and open along the top row.

C) The window will display the entire program.

D) For those of you who do not have a Sherline-supplied computer we are now going to create a file we will call “0-new.” (If you have a Sherline computer with the “0-new” file already on it, open it and go to section 2) below.) First go back to the [Editor] window by right-clicking your mouse. By having a “0” as the first character of the file name it will always keep this file at the beginning of the program list. This makes it easy to find, because you are going to use it again and again. From the [Edit] window, use [File] then [Save as] (located along the top of the edit window) to save our existing program as “0-new.”

E) Next, highlight (with the mouse button held down drag the cursor across the entire area you wish to highlight) and delete (press enter) the existing program with your mouse. Replace that program by typing “Save as another file name.” 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 “test-g02”. 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. Note: “test-g02” is the first program you’ll write. Program files are saved in the directory called “/home/Sherline/gcode”.  In the EMC, the programs will be saved here by default. HANDY HINT: You can always look at all the program files by clicking on the “Home” icon on the desktop. From here click on the folder entitled “gcode.” You will find instructions for saving them to a floppy a few paragraphs further on.

3) You have to ge