Robert R. Fenichel

Tormach PCNC 770 mill

The 770 represents my first exposure to CNC machining.  I have been proceeding slowly, trying to do the least damage while I climb the learning curve.  So far, blunders have cost me only one endmill, one wiggler edge detector, and one bellows-like way cover.

gCode utilities

On the old SX3. I did a lot of my work by ear, feeding the table and changing the spindle speed until the machine stuttered, then backing off.  It is (barely) possible to run a CNC mill that way, but it is inefficient, to say the least.  For common tasks (shaving down a rough surface to make it level, drilling a (relatively) small hole, milling a bigger hole, chamfering an edge, etc.), one wants to be able to draw upon stereotypical CNC programming.

Programming of the 770 (and most other CNC machines) is done in gCode, a low-level programming language.  CAD/CAM programs (I don't have one) produce gCode.  gCode has recently been extended to include named variables and control structures (if/elseif/endif, call, sub/endsub/return, while/endwhile, repeat/endrepeat, break/continue) of the sort that have been present in ordinary programming languages for 50 or 60 years, but CAD/CAM programs don't seem to make use of them, and some otherwise modern-spirited organizations (Tormach, for example) deprecate their use.  

The common way to provide stereotypical gCode programs is through "wizards" that accept parameters and generate gCode to accomplish the specified task.  The wizards I'm aware of (Tormach's own and that of GWizard) don't use any of the modern gCode features, so they produce code in which every repetitive operation has been unwound into many, many microsteps.  In programming terms, it is premature binding run amok.  In a typical case, an operation describable in 100 or so lines of readable annotated gCode is specified in wizard output of 3000 cryptic lines.

The need for canned solutions for recurrent mid-level machining problems is not well met by the wizards.  What is needed is a library of parameterized gCode routines.

I have begun construction of such a library; contributions from other gCoders will be welcome.  The routines I've completed to date are available in this directory (updated 2017-07-18).  

The Tormach controller provides a simulator for gCode programs, but not a syntax checker.  As a result, syntax errors are not reported in lines that (data-dependently) are temporarily not reachable.  Also, the simulator reports syntax errors within subroutines as having occurred within the caller routine, so locating the error is often time-consuming.  I have prepared a syntax-checker program that runs stably in the Windows 7/64 environment.  It probably runs in other versions of Windows, too.  The source and executable are available here (updated 2017-07-22).


Page revised: 2017-07-22 11:40