FILENAMES: CNCV198d.zip DESCRIPTION: This zip contains a demo version of the G and M code front end software that Hoyt McKagen wrote for the LTP stepper driver software. Hoyt provided the following description: ========================================================================= : CNCv198/199 is an update of CNCv117, a versatile conversational interpreter and script generator for Indexer-LPT (a software product by Ability Systems Corp, 1422 Arnold Ave, Roslyn PA, 19001, 215-657-4338, or see http://www.abilitysystems.com/). Belfab is not otherwise associated with ABC. This text and all related software (C) 1998 by Hoyt McKagen, 3676 Old Creek Road, Blacksburg, VA 24060, 540 552 0722. Release date for CNCv198 is Nov 15, 1998. Contact as above, or batwings@i-plus.net, or see following URL: http://www.freeyellow.com/members/belfab/belfab.html. CNCv198 interfaces the Indexer by direct writes and reads. It uses single keystroke entry for nearly everything except dimensions and settings and is fully configurable. It generates, saves and re-runs complex scripts for ordinary motions and complex canned routines. To run you must have Indexer-LPT installed according to the instructions included with it, have a copy of CNCv198 in your working directory or pathed to that, have the printer cards installed and set to appropriate addresses, and ports must be connected to the physical machine stepper/servo drivers. You may test the program w/o Indexer-LPT and hardware by creating a dummy file named `motor' in the working directory (see 'Files'). CNCv198 will operate on DOS machines back to 8088-series and in as little as 512K, and since it is tiny (~77K) it is fast. CNCv198 is intended to run testing machines, robots, factory automation, routers, cutting machines and any other multi-axis stepping tasks. Axis-labeling convention follows typical three-axis milling and canned routines are for lathes and mills or combination machines and small lot or prototyping work. CNCv198 can run simaltaneous jobs on different machines of total of six axes, with movement, tool and work changes in any order. Both CNCv198 and Indexer-LPT will run together under the DOS box in Windows 3.1/95/98. A) Operation Menu items are shown with part set off with <>. The letter which is inside the <> is the keyboard entry to select the function you wish to use. If the letter set off is lower case such as in ?: you must enter it and then terminate entry with the Enter key. If the included letter is a capital, you use enter key alone to go on. Foe example, - means to enter your choice of axis. Each time you terminate a sequence the motion begins immediately. If you wish to suspend CNCv198 operations, you may use the `Break' key. Indexer-LPT will finish the motion under its control and CNCv198 will stop at the next motion. You may resume with the Enter key. If you wish to stop Indexer-LPT in mid-motion, you must initialize and use the appropriate features contained in it, which you may do through CNCv198 config.dat. CNCv198 on opening loads config and tool data and the asks if you wish to set home/zero axes. If you are working on a project and have already set home/zeros you will wish to skip that. It then asks for units to use, and you may skip that if you wish to default to inches. The next material displayed is the main menu: nit, og, sale, et,

rogram, un, DOS shel, uit?: 1) nit selects the same routine as displayed on opening screen. You may change units at any time w/o affecting operation, and since command files are written in steps, your output will be correct and may be re-used w/o changes whatever mixture of units is input. 2) og is primarily for moving the machine's axes during setup. Jogs are not written to file. The jog you have defined is repeated each time you Enter. og starts with prompts setting up the jogmove. The Jog Step # is the exponent of a pow10 routine. In CNCv198 the menu prompts with JS values of 0 (one step) to 4 (10,000), but you can enter larger exponents if your physical machine is big enough. You may cancel a jog move by using a JS of -1, which produces a move of less than one step, rounded to 0 and not regarded as a valid move by the indexer. You may quickly change jog parameters using the menu displayed after the first jog, or use other functions: Sam, everse, tepsize, ool offset, set hoe, - o?: Sam repeats the axis and step size everse changes direction and prompts for new step size. tepsize changes only magnitude. - allows entry of new axis and prompts for new stepsize ool offsets are recorded as either a-b or c-d position or a-b-c or d-e-f position and diameter. If the last axis jogged was c or f, you are prompted for a tool diameter, on assumption that you are setting a milling cutter or drill. If the last axis jogged was a or b, or c or d, the tool is presumed to be a lathe tool and only the a-b offsets are recorded. This is to prevent spurious motion of the vertical axis during tool changes when using the a-b or c-d axes only. Any offsets can be overwritten by reusing that number. All offsets and diameters are recorded in steps. Tool.fil has 5 tool numbers available in demo and 100 in ful ver. hoe sets the position value of the axis jogged to 0. After setting tool offsets or hoe, og menu appears again and you must select same or other axis/stepsize again to proceed. closes og menu 3) sale is for changing toolpath size on runback. Scale is not in demo version. 4) et defines parameters for operation. You may choose et also from within

rogram. Settings which are commands are written to file with other commands. Those are variables are assigned in memory. Settings default to slow genreally safe values. Settings menu is: feed:ow, acel, igh, ais, ogspeed rc; conig, axe,

itch, indings, coner, prese, pec, clar, hoe, lock, o?: "); conig (not in demo) writes to disk current feedrates and settings in memory. The six choices after 'feed:' generate Indexer-LPT commands and are covered in Indexer-LPT manual. All settings are entered in whatever unit is selected and converted to steps. If entry generates less than one step/sec, an error is displayed. igh is the maximum feed rate for all axes. ais allows one to set high speed for rapid moves for each axis. axe sets a,b,c or d,e,f as defaults for canned routines. Output file code reflects either default axes or axes selected by user as prompted.

itch prompts for lead screw factors and sets the variables used by unit. If you have different lead screw pitches on some axes, you may reset the pitch between commands to get the right dimensions, but this will not work with canned functions.

itch defaults to inch units across a 5mm pitch screw and 1000 steps/rev. Demo users must set their lead values on opening.

reset axis turns off windings and counts off a false move, then turns the selected axis back on. (Most steppers will hold in place with power off, but you still must guard against losing position during that period. You may address electromechanical interlocks if necessary with a dedicated axis on one of your cards, using strins, below). This setting and indings both require the proper computer port pin connection to the motor amplifier card to be effective in service. If the proper port pin is not connected to your amplifier cards to disable windings, this command will move the selected axis the offset amount. indings is a toggle for the stepper power, not in demo. coner sets the edge radius used by urn and ore; default 0 steps. pec sets the depth of first and subsequent drilling pecks; default 500 and 200 steps. clarance is the amount that the tool rises above work surface when moving sideways in vertically-oriented operations; default 200 steps. For using canned vertical routines, the tool must be first delivered to the height of the clearance plane. hoe sets each axis chosen to 0 position; this is different from ome in

rogram, which moves axes back to the mechanical 0 position. It is like hoe in og and like that is intended mostly for setup use. hoe is NOT recorded in work.fil or user's files as a command step; if you wish to actually reset an axis to 0 while programming and have that recorded in output file, you may use strins (below). lock is the number of last lines of the file that are re-run to overcome imperfect cutting exits from water-jet or laser flare. Not in demo. The number entered is the number of lines rerun. lock is also used by the emergency routine. Blocks may be re-run any time within a file. 5)

rogram mode lists machining modules and three functions for file handling. This is the manual data entry mode. Commands are also written to file for later use. In the demo you are limited to a fixed number (approx 100) of lines. If you have embedded CNCv198-specific strings you must run these files back through CNCv198, as Indexer-LPT on its own will not recognise these commands and will not pause as appropriate for tool changes nor find subs/macros. The

rogram menu is: strins, fle, sn, sae, et, nit, ome, ove, eed, rc, ircle, urn, ore, heli, drilling: ect,

olar, spt, o?: strins mode is used to enter commands or code not programmed into CNCv198, by typing in the literal command. For example, using strings mode with Indexer-LPT queuing commands allows you to take advantage of its powerful feed interpolation feature, for complex hi-speed motion profiles without pauses. This is also useful for entering utility and modal G.., M.., etc codes. If you use strins to send motion commands or settings, they must be in steps. You may also enter strings for CNCv198 alone (see below) or use it to put comments into any user files. All strings input are saved, but Indexer-LPT ignores all commands not in its specific format: If you have embedded CNCv198 commands such as tool changes in your scripts you must run them back through CNCv198. fle selects a handle for saved files. All subsequently entered commands are written under that name. sn allows contents of one file to be run at machine and at the same time appended to a job file being programmed. If no job file is open, sn appends the named file to work.fil. sn is non-modal and must be selected for each file added. sae entry terminates writing commands to the file named and restarts the work.fil for appending, with a blank line between sections. ome returns the prompted axis to the physical position set as 0. ove prompts for one axis and signed magnitude and moves at ogspeed. Indexer-LPT allows multiple-axis moves, which you may call through strins. eed prompts for a series of axes and signed magnitudes, starts with feedow and accelerates to feedigh by whatever acel is set. You can enter axes and corresponding units in any order and must terminate the series of inputs with an entry of `n'. rc prompts for arc-point or arc-angle with any two axes and signed magnitudes. The axes are moved to produce velocity according to feedrc. With rc, ircle and heli, which axis is entered first is determined by a hand rule: imagine the right hand fully grasping a vertical pole, but with forefinger extended away from body. Looking down the pole, The second, ring and last fingers denote the direction of arc motion, in this case ccw. The index finger is parallel to the first axis and the thumb generally parallel to the other. ircle prompts for any two axes and signed magnitudes and moves at feedrc. urn is a multi-pass routine on a and b or d and e axes. There are several options embedded. It first prompts for trial cut and trial length, double-passes the trial settings, then stops and prompts for actual diameter which you may measure and enter. If 0 is entered for trial stepover no trial cut is taken and you are prompted for present diameter. If present diameter is entered as 0, the routine breaks back to menu, hence it can be used to make single cuts of known size by stopping with the trial cut. If a present dia is given, it prompts for intended diameter, roughing step-over, finish step-over, and overall length, all as absolute magnitudes. It finishes trial pass, takes specified cuts until close to finish pass, takes the remaining difference and the finish cut. If finish stepover is 0, no finish step will be taken. It then puts the corner radius (if set) on the end from which it started, and stops at the coordinates of the end and final diameter. If after re-measuring the OD additional material needs to be taken from the same place, it may be done by re-entering the routine from the menu and using 0 for trial cut. You may also enter an amount to be taken off by entering it when prompted for present dia and entering 0 for intended dia. The urn routine feeds (not moves) in before each pass, hence it can start working from barely inside a rough end on a piece of stock, and it also finishes the shoulder remaining at the big end of the stock while turning. ore does the same thing as urn, but inside the work and with the opposite sense. It also withdraws from the bore far enough to make an inside measurement before setting up for the remaining passes. By using an indexing toolpost such as Aloris, one can take the tool off for easier measurement. heli prompts for direction, diameter, first of two axes to be used for circular motion, and designates second circular and vertical axes. heli is cutter-dia comped using tool number in effect when called and prompts for nside or utside cutting, or if no tool dia is in effect it uses the entered diameter for the toolpath. It alse requires pitch (depth/turn) and number of turns to be entered. It can cut spiral ramps in fractions of one turn and may be used for circular pockets and islands and/or thread milling. heli works only from top to bottom. It starts at clearance distance above center of the circular motion and stops at the position of last move. Not in the demo. drilling: ect prompts for number of holes and signed spacings on an a-b or d-e array. It starts from clearance height at the position of the first hole and drills each row with c or f axis respectively, and then steps over to each next row. It uses peck drilling with defaults or user-defined increments and leaves the tool the clearance distance above the position of the last hole drilled. Not in demo.

olar does the same as above, but on a polar coordinate basis, making a bolt circle. It starts and ends the clearance distance above the center point of the circle. Not in demo. spt moves to, stops at and peck-drills at successive locations, on user inputs. It starts and ends the clearance distance above workplane. 6) un mode prompts for existing filename and sends it line by line to Indexer-LPT, with screen echo. If the file has embedded commands for CNCv198, it intercepts these and takes appropriate action before resuming machining. You may not run work.fil or user files until they are saved. You may flag it for single stepping and/or use emergency hot-key to halt motion (not in demo). By pressing any key during file re-run, the motion stops with the next line and emergency menu is displayed: ool, sto

, tep ool retracts vertical axis to home and the machine may be jogged as necessary for changing tool. The machine then travels from where-ever left, to the appropriate position for the first of the re-run blocks, drops to working depth and continues program. sto

ends running program and machine is left in place. tep shifts program running to modal single step mode, with optional return to automatic control or sto

. 7) DOS shell loads command.com for operations external to CNCv198. 8) uit exits CNCv198. B) Files All files are ASCII and may be edited by standard means if needed. All files are closed on exit whatever their status. Files containing embedded CNCv198 strings cannot run with Indexer-LPT under DOS alone but may be edited into smaller files, according the locations within them of the embedded material. These files can then be run back to Indexer-LPT separately using methods as described in Indexer-LPT materials on using files from DOS. 1) If a config.dat doesn't exist on startup, CNCv198 writes one using system defaults and uses that; your Indexer must be loaded when this occurs to be effective. You may generate an alternative config.dat of Indexer-LPT feeds and other settings specific to your machine and jobs, using these steps:

rogram, flename: config.dat, ettings: settings choices desired, o (to get back to

rogram), (optional) strins, sae. This overwrites any previous config.dat and the new one will be loaded on startup instead. Then you should go to the main menu and un: config.dat to make changes effective. Since config files are the same as any other you may keep several under different names for specific jobs, however only the configuration actually labled as above will run on startup. IF you use config.dat to set feeds, you MUST set feed-low speed BEFORE you set feed-high and you must make high bigger. You should never use motion commands in your config.dat. It's good practice to include windings disable commands in it and you should turn on in your programs only those axes needed for operations. 2) The work.fil contains all commands entered in

rogram and ettings, if a user filename is not selected. The work.fil is a temp intended for any use you like, and is overwritten each time CNCv198 is started. The first lines are always filled with system defaults and user commands are appended to that. Work file is appended with subsequent commands if a user-named file is saved, with a blank line between groups of commands. Using sae with work.fil alone will insert a blank line. 3) User files: If fle is selected, all subsequent commands are entered into it. The name may be anything fitting PC-DOS conventions. sae writes and closes this file and reopens work.fil for appending. 4) tool.dat contains tool offsets and diameters, is written with each entry of offsets and is loaded at startup. 5) You may create the dummy file 'motor' (no punctuation) with any ASCII editor, to test CNCv198 without Indexer-LPT. It must have in it a few characters, such as: test file. If you use this file it will be returned to you in the position display the first time you run CNCv198, and it will be overwritten then with everything that would be sent to the actual device driver, if present. After running in simulation, you should examine the 'motor' file contents and those of the work.fil and user files. Delete the 'motor' file before actually installing Indexer-LPT. 6) settings.dat contains variables used in CNCv198, some of which are used for feed rates and may duplicate some of the commmands found in config.dat; if so whichever is the last file to be run will predominate. C) CNCv198 strins CNCv198 has its own strings to simplify output files. These do specific things that are not utilized by Indexer-LPT. It is possible to write complex programs using CNCv198 with Indexer-LPT commands alone, but using this feature shortens programing steps. These strings begin with an asterisk and have a letter and optional number. Except for *t# and *p, these are all in Ver 2.00, in development. CNCv198 strings are entered complete, after the strins prompt is shown. There is no menu for them. *s# begins a block of output code. Subs are first written to a separate file and when the main file is saved, they are appended to it. *e ends subs. No *e is needed for ending main program. *c# calls the sub indicated by #. If an existing sub is called, it is run, producing all motions within it. If not the next motions entered are made and the commands for them are automatically saved as that *s#, up to the point where *e is entered. The sub can be called again immediately. *l# calls the sub # indicated and loops it. You may enter a,b or c,d axis offsets when prompted or you may use zero values and include required moves in the sub itself. *t# calls tool changes. It physically homes the axes and pauses operations for the change, applies the recorded offsets, and returns physical tool to its own zeropoint and/or clearance. If a tool is not defined under the number given, the system calls og and you can then touch off the actual tool and record the offsets for it. The machine then continues motion on subsequent inputs from where you left the tool. Preset or on-the-fly the generated output file code reflects the sums of the involved motions and jogs in the tool change, for repeating those changes in re-running. On vertical tools, it floats the workplane clearance back in before continuing. *p holds CNCv198 motion sequence until a keystroke, on re-run files only. This cannot be entered to halt motion during programming (use `break' or Indexer-LPT's feedhold feature for that), but is for pauses other than for *t# are needed in re-running the file. *m (macros) in CNCv198 are any other file or machine script using valid PC-DOS filename. They differ from subs, which are defined blocks within user files. If macros have embedded subs, they are also run with it. Macro contents are not read into the user file, but the *m string appears there with the macro filename. *b returns to positions and re-runs preset number of previous lines in file. Other strings headed with * are used by CNCv198 in the settings.dat to designate saved variables and are not directly entered by the operator. These may be edited in the config.dat if desired. They are defined in App. 2. D) CNCGv199 This version is intended to support X-Y-Z G-code users. Having the same look/feel, it does not drive motion but does output G-code to file. All motion/file functions in CNCv198 are available. CNCGv199 emits G-code supporting G00-03, G12-13, G80-86, and all Gxx, Hxx, Fxx, Sxx, Lxx, and Mxx modal and utility commands, either by specific command format or by emitting equivilent blocks of code; the latter means allows greater flexibilty for systems using non-standard G-code implementation. Commands not directly supported may be entered into output files with strins function. E) Safety CNCv198 is a passive device; it will not produce any action that is not initiated by programmers and operators. Hence: USERS OF CNCV198 ACCEPT ALL RESPONSIBILITY FOR SAFETY AND BY USE OF CNCV198 INDEMNIFY AMD RELEASE BelFab AND ALL Belfab EMPLOYEES AND PERSONNEL FROM ALL CLAIMS FOR DAMAGE OR LIABILITY. One thing of great importance in CNC machining is proper work and tool holding and feeding rates, with consequent emphasis on tool configuration and condition. The machine may not stop under failure conditions, so adequate safety margin must be built in in your choices of settings. It is user's responsibility to insure adequate electronic and physical safeguards in addition to good practice. All motions in CNCv198 are relative to standard 3-axis milling machine designations: `a' is table/carriage, X, or long; `b' is cross, Y, or short; `c' is vertical or Z. Axes `d,e,f' repeat this pattern. Sign is determined by reference to the third axis' apparent travel, plus motion on long and cross together being in the first quadrant and plus vertical being upward. This is possibly not consistant with axis designation for turning operations and/or DRO or other readouts and/or your present machine polarity. You must keep in mind the proper axis according to the above when using or programming with CNCv198, especially with real-time modes. Keep in mind also that CNCv198 defaults to some axes in some modes (ore/urn, etc) and requires user input on others (ove, eed, etc); you will always be prompted for these if necessary and preset defaults will remain in effect afterward. It is also the user's responsibility to begin and exit routines at the right physical locations. Indexer-LPT and other drivers employ a wide range of setup commands and related physical safety devices. Not all of these are implemented in code in CNCv198 because the exact configuration of machines is not standard. Users are responsible fo employing devices to insure safety, and activate them directly with Indexer-LPT or other product by running config.dat files of the right commands depending on the job. Alternatively, motion code generated by CNCv198 may be preceeded by strin mode commands to set up the machine and the user file at once, or standard config code may be pasted into CNCv198 files with text editors. App. 1) Bug-fixes and revisions: 1) F: unable to leave axes preset on opening 2) F: unable to default to inch units 3) F: unable to switch default axes 4) F: unable to accept user-spec'd feed-high from config.dat 5) F: max stepcount increased 1) R: added line counter for demo 2) R: tool retracted farther in ore module 3) R: set coner radius default to 0 for turning and boring 4) R: cleaner og routine interface 5) R: added step size change when reversing jog 6) R: added - to jog menu 7) R: revise file handling routines 8) R: new motion default values 9) R: all settings entered in units, saved in steps 10) R: all tool dias entered in units, saved in steps 11) R: added DOS shell 12) R: added sn 13) R: added settings.dat 14) R: CNCGv199, G-code generator 15) R: interactive file running 16) R: block retrace App. 2) Names of CNCv198 variables in config.dat *L# Low speed all axes *H# High speed all axes, used for jogging; must be higher than low speed *A# Arc feedrate *B# Block retrace value *C# Acceleration *E# Vertical clearance *R# Corner radius for turning and boring *K# First peck *S# Second peck *P# Pitch factor for leadscrews *U# Units factor *V# Steps/rev