Friday, March 9, 2012

One more thing about G-code

One thing that I haven't said and I think is quite important to mention, some of this stuff won't make all that much sense until you're able to get your hands on a CNC mill or lathe and literally play with it. It's hard to understand what exactly each G or M code does without sitting at the machine, typing it in and then pressing the start button to see what the machine does.

There have been people in my Intro to CNC class who have been discouraged because they feel they are lost with G-coding and haven't had any hands on experience with the CNC machines themselves. So I know it's difficult to to fully grasp the coding without using it (which is one nice thing about CNC simulator software), but once you get that chance to use the machines, things quickly start to make sense. The point being, don't get discouraged.

You think Apple's are expensive? Check out Haas' prices

To pick on Haas Automation, makers of CNC Mills, Lathes, etc. for a moment, I was looking through their website (which could be better) and getting prices on their different mills, when I stumbled upon this gem. Has charges almost $1500 for an Ethernet adapter. They also charge $1600 for 750MB of solid state "memory." I just looked on NewEgg and I can get a 60GB SSD for under $100. And let's not kid ourselves, their 750MB is no SSD, it's a tiny chip of the same type used in your USB FlashDrive or what you're using in your camera. I can get a 16GB Micro SD card for $10. TEN DOLLARS. So for what Haas is charging, I should get about 2,560 GB (around 2.5 TB, but if we're going that high, I bought a 3 TB external hard drive 6 months ago for $100) of storage space if I just bought 160 16gb SD cards. Which would be silly, but rather my point is that there are upgrades and reasons to charge for R&D and the like, but $1600 for a tiny chip that costs them almost nothing to build into what is quickly becoming a "laptop in a box" controller running specialized controller software is beyond outrageous. Haas really should be ashamed of themselves.

Of course, my favorite upgrade/option that Haas offers is M-Code/MFIN Cable assembly for $300, which is nothing more than 4 pieces of 5 feet of standard red/black 20ish gauge wire connected with some type of DIN adapter (I'm not quite sure what type of connector that is). 20 feet of wire and a connector for $300. I'm in the wrong business.

Really Haas, shameful.

How Much Does Bad Design Cost?

I'm going to go on a tangent here and ask a question that I think is very much related to CNC systems as well as many many other fields.

How much does bad design cost? How much does wasted effort do we lose in any given time frame due to poor human interface design? I'm no user interface or even design expert, but I do know poor user interfaces and bad design decisions when I see them. And given the amount of time that these poorly designed interfaces waste, and time being money, I can't help but wonder how much wasted energy and effort goes on every year.

There has been plenty written by others on user interface design, so I feel like I'm just wasting my time, especially as a non-expert, but I'm going to focus on design issues that I've seen just within the CNC world in the past few months of using these machines. One reason that I've asked this particular question of the CNC world is that when machining parts with CNC mills for instance, the cutting head is typically moved at a rapid speed (G00 for you playing the at home game of "what's that G-code!" On newer machines, this speed is "blink and you miss it fast," or "holy crap!" fast.) of 0.1 inches from the part to be cut. The reason for doing this is because when you're making 1000 thousand parts, to move the cutting head further from the part will add a fraction of a second to each movement. With 20 different rapid movements around the part and 1000 pieces, this fraction of a second adds up to some real time. And it's all about efficient usage of time, because these machines are used for business.

When it comes to the computer controllers of CNC mills, lathes, and other tools, there are a wide variety of manufacturers and thus totally different systems in place, each with it's own unique interface. This in and of itself is not necessarily bad, but when you're talking about machines that are essentially capable of doing around 90% of doing the same thing as the other controllers of their age, you have to waste a bit of time figuring out all the nuances and details of each one to properly learn how to do the exact same thing with each controller. The time wasted is relatively small generally, as at least many of the same commands can be found if looked for on different controllers within a few minutes. However, the lack of standardization among the controllers can be pretty maddening when working with more than 1 brand of controller.

One of the worst design decisions I've seen so far working with CNC has been on a 1985 Mori Seiki SL-1A lathe with a Japanese clone of a Fanuc controller. In the world of CNC, you work with fractions of inches. So you're used to seeing something like 0.0050 on a controller, or something needs to be plus or minus 0.003 inches to be within spec. That's normal. But what this particular controller does to make your life so easy is to leave out all leading zeros. The display will look something like this (leaving a completely blank space for the underscore) _.__50 It is necessary to count from right to left to see how many leading spaces are there. In this case the number is 0.0050. It is quite annoying to have to spend time just reading a monitor to see how much you need to move the part around.

Which leads me back to the question, how much time do all of these minor details cost us each year? Sure, somebody who works on a machine for a while will certainly get the hang of these quirks and get to the point where they ignore them, but doesn't it make more sense to make better controllers that take less training and are easier and quicker to use?

I'm going to leave it at that for this post, but I'm going to be coming back to this topic, because one thing I hate is bad user interface design. If I had a time machine, I'd probably go back in time and kill the guy who designed this CNC controller before I went back to kill Hitler. I'd probably save more than 1 person from stress induced heart attacks.

Thursday, March 8, 2012

More Resources for beginner CNC

This post is just going to be some basic links in part for my reference. I'm also going to go back and add more details about each section as I go along, but for now I'm just focusing on an overview of all the basic aspects of general CNC.

If people are really interested in this stuff, I would recommend Haas' (a CNC manufacturer) manual for it's Mills and Lathes that can be found on this page. This manual is actually pretty useful at getting an understanding of CNC and gives a rundown on the entire machine, the different parts, the controller and the buttons and what they do. It even gives examples of G-code. All in all, in itself it's not a bad (but basic) starter manual to help at least give you ideas on what better to research.

For CAM software, MasterCam is what I'm used to using now, but I think their website is a pain to sort through, and none of their documents are easily and freely available online. They want you to pay for everything, and I do mean everything. I'm not above making a buck, but I think their method is quite short sighted and has already forced me to look for alternatives. The software itself is quite good, but what good is a software if you don't know how to use it properly and the company makes it difficult to learn how.

Right now, it's a more basic form of software, with certain limitations and is purely a CAM system (meaning you'll have to use a CAD program to design the part) but FreeMill is a decent little system to use. Unfortunately it only imports certain basic file types, and it does have it's limitations, but you can't beat the price. What's more is that a few days after downloading it, I received a phone call from the makers of FreeMill, MecSoft, asking me how I liked the program and if I had any questions. Of course they were trying to upsell me as well, but I can't blame them for that, the very fact that they called me and let me know that I was an important customer (who downloaded the software for free) impressed me. Good customer service is hard to beat.

At school I'm able to use a number of different design and CAD programs, such as AutoDesk, SolidWorks, etc. At home I have more limited resources and am currently using a beta version of Rhino3d for the Mac. But there are all sorts of free design software packages available (FreeCAD). Two of the more popular ones would probably be Google Sketchup and Blender. One thing to keep in mind though is that Sketchup and Blender are more about design than actual CAD. I believe Blender offers a CAD add-on but I have know nothing about it. The difference between these design programs (like Sketchup) and CAD (like SolidWorks) probably has more to do with the philosophy of design behind the software. CAD will be more structured for the user to input fixed coordinates and fixed values for length and width and so on. Design software in many ways is more "free form," and make it easier for you to make more organic shapes, but when trying to make precise mechanical parts may not be as useful. But both tools have their place and it's up to the user to figure out what they need.

And of course, for those who want to hand code their G-code, remember that each manufacturer tends to have their own G-code system (why they didn't come up with a standardized system of G-code I will never understand). And that codes on Lathe's and Mills are sometimes different and do different things. Also, when saving a file for your g-code, remember to put a "%" sign at the very beginning and end of the program. Finally, here's a decent reference list of the g-codes that is somewhat standard on all machines (though don't hold me to that, I'm sure there are some machines out there that this will not work on, but it should work on most.)

And to test that handwritten software, there are CNC simulators that take your code and simulate the actual machining of parts, showing the visual movement of the machine head and the subtraction of material off of a part. MasterCAM has this built into the program, but other applications exist, such as CNCSimulator. It's a nice way to make sure you don't go crashing the machine because you forgot some minor detail (like forgetting a decimal point.)

I think that's a good starting point for some references and an overview of the software that's now available. Obviously there's a lot more out there, but a quick Google search should help you find what you're looking for.

The most important thing to CNC

Well, that might be overstating it a bit as there are plenty of steps when starting a new part that you can mess up, such as part material, size, tool setup, a good program, and so on. But one aspect that might be easy to skip for someone new to CNC (like myself) is properly setting up the machine, or setting machine home. This is not actually necessary on many of the newer CNC machines that have come out in the past few years, but on older machines this is still quite necessary.

All it is is telling the machine where exactly the x0, y0, z0 position is. If the machine knows exactly where zero x, y, and z is, then it is capable of making accurate movements away from this position, otherwise the machine may be off and the machined parts would be out of specification.

On older machines, the steps necessary to perform this setting up zeros was quite involved (at least compared to new machines that either find zero automatically upon startup, or which require one button press). An older lathe for example (which only has two axis, an X and Z, with Z going from the head stock to the tail stock and Z being the top of the machine going towards the bottom (usually)) first needs to have the axis moved away from zero manually (using a joystick), and then tell the center to automatically move them back, and then telling the machine that now they're in zero, that the machine's coordinates should read zero. Which might not seem too bad, but each step requires pushing a few different buttons, so it can get complicated quickly.

After using a newer machine, you're quickly spoiled by pushing the green power button and 1 other button to have the machine automatically zero itself, but it's mighty important that you don't forget, otherwise all of your parts will be flawed from the very start.