CNC Controller 2.01.02

Copyright © 1995, 1996 Microsystems of Buckhannon Inc. 14 East Lincoln Street, Buckhannon, WV 26201 (304)472-7206

Microsystems of Buckhannon Inc. makes no warranties, either expressed or implied, including any implied warranties of fitness for a specific purpose, for this software. This package is provided solely on an “as is” basis. All risk involved in the use of this software is the responsibility of the purchaser. Program errors, improper software configuration, hardware failures, or other problems can result in damage to the machinery being controlled. Failure of limit switches, cabling, or port components can result in machine movement past limits, potentially damaging the machine and endangering operators. It is imperative that a separate Emergency Stop system be in place which bypasses all computer control. Software features to abort motion from the keyboard and limit switch inputs are provided as conveniences only, and must not be relied upon to stop motion in an emergency. Microsystems of Buckhannon Inc. disclaims all liability for any and all damages, including incidental and consequential damages in connection with use of this software. The sole and exclusive liability of Microsystems of Buckhannon Inc. will be limited to the purchase price of this software package. If you do not understand and agree with these disclaimers, please do not use this product. Return all materials to the place of purchase for a full refund. CNC Controller Contents

Installation 1 - 1

Program Operation 2 - 1

Command Reference 3 - 1

System Configuration 4 - 1

Error Codes 5 - 1 CNC Controller Installation

CAUTION: DO NOT USE THIS SOFTWARE ON A COMPUTER CONNECTED TO A MACHINE UNLESS THERE IS AN EMERGENCY STOP READILY AVAILABLE WHICH WILL INDEPENDENTLY STOP THE MACHINE. Software features to abort moves from the keyboard and limit switch inputs cannot be relied upon in emergency situations and are provided as conveniences only! Requirements: CNC Controller requires a PC compatible computer with 386 or faster processor, and a hard drive. A 486DX or is recommended. Make sure your turbo button is on. Slower computers or turbo off will result in abnormal acceleration and other problems. CNC Controller will not run from Windows 3.1. It may be run in MS-DOS mode from a Windows 95 machine. Software Installation: Insert the CNC Controller diskette into th floppy drive and type a:install (or b:install if installing from drive B) The install routine will create the directory c:\cnc if it does not exist and copy the necessary files into it. If there is a previous installation of CNC controller the file cnc2.exe will be overwritten, the cnc2.ini file will not be changed.

Plug the software key into one of the printer ports of the computer. Connect the cables from your motor driver to the ports you use. One cable may be connected through the software key. The software will only run in demo mode without the key. Some Terminate and Stay Resident Programs (TSR’s) may interfere with program operation. Specifically other software indexers and print spoolers should not be loaded while using CNC Controller. Check your config.sys file and remove or “rem” any print spoolers or indexer TSR’s. Run the program from the directory you created by going to the CNC directory (cd \cnc) and the typing “run” at the C:\CNC> prompt. If you add C:\CNC to the dos path then CNC Controller may be run from any directory. This can be useful if you want to keep associated part files in their own directory and change to that directory before running CNC Controller. It is also necessary to have the CNC directory in the path to edit files from CNC Controller. If you install CNC Controller into a directory other than C:\CNC then the “dir=” line in CNC2.INI must be changed to the new directory.

Program Configuration: CNC2.INI is read on program startup. The default file is setup to work with minimal change for normal installations. To change configuration use a text editor to edit CNC2.INI. If your are running DOS verision 5 or later use EDIT. If you use a word processor to change CNC2.INI make certain that you save as in ascii text format. Example: (using edit) C:\> cd \cnc C:\CNC> edit cnc2.ini

After editing type Alt-F Alt-S to save and Alt-F Alt-X to exit

Users Guide 1 - 1 CNC Controller Installation

CNC.INI Settings: Many CNC.INI settings are similar except for the axis specifier or the port number etc. In this case the reference below will specify the parameter to be changed in <>. For example: chan would be typed as xchan, ychan, zchan etc. aux<#> would be typed as aux1, aux2, aux3, etc.

Axis and Port Settings: CNC.INI Description [Number of Axises] axis=4 set number of axises from 2 to 6 (Level 1 is limited to 4 axis) pulse_12=2 set pulse width for 0x278 port ( Value must be 1,2 or 3) pulse_34=2 set pulse width for 0x378 port pulse_56=2 set pulse width for 0x3BC port stepdiv=4 pulse accuracy - use 4 for 486 and - 2 or 0 for slower machines

Pulse widths vary with cpu speed. Approximate pulse widths for 486DX-66 are : 1 = 5 microseconds 2 = 10 microseconds 3 = 15 microseconds

Set Channels [ Axis] chan=# # is channel 1 to 6

Each axis is assigned to a port channel. The channel setting assigns default control bits to the axis specified. Allowed axises are X,Y,Z,W,U, and V. Axises must be assigned in order. For example if you have a 3 axis machine X,Y, and Z must be used. Z may not be skipped. Channels 1, 3, and 5 use the lower 4 bits of the port. Channels 2, 4, and 6 use the higher 4 bits. Channels 1 and 2 refer to port 0x278 Channels 3 and 4 refer to port 0x378 Channels 5 and 6 refer to port 0x3BC

Set Directions _dir_pos=0 The default for the direction setting is 1. If an axis moves in the wrong direction, then add this line after the channel setting otherwise leave this line out.

Set Resolution res=#.# Set to the actual resolution in steps/unit. (ie. steps/inch)

Users Guide 1 - 2 CNC Controller Installation

Limit Switches: The default channel settings will normally provide proper interfacing with the machine’s limit switches. Before atttempting to move the machine verify that all limit switches are functioning properly. Limit switch status is displayed in the position window as “<“ and “>“ around the axis labels. If no limit switches are closed the position display should show only “X”,”Y”,”Z”,”W”. “<“ in front of an axis indicates that the low limit switch for that axis is closed. “>“ after the axis label indicates that the high limit switch is closed. First toggle your limit switches by hand. Verify that the appropriate limit display toggles. If it does not toggle then you need to adjust CNC2.INI. See the CNC2.INI reference section of the manual if the default settings are incorrect for your machine. It is recommended that you verify limit switch operation at the beginning of each operating session.

Movement: Do not attempt movement until the limit switches and displays toggle correctly. Once the limits are working try a small move. If nothing moves, the wrong axis moves, or movement is in the wrong direction then adjust CNC2.INI. Perhaps the easiest way to do preliminary testing of movement is with the Jog mode. Push F6 to select Jog .1”. Use the LEFT and RIGHT to move X, the UP and DOWN arrows to move Y, the PAGEUP and PAGEDOWN keys to move Z and U, and the HOME and END keys to move W and V. The SCROLL toggles between ZW and UV. If the light off Z or W will move. If the light is on U or V will move. Make certain that each axis moves in the proper direction. If it moves the wrong way the limit switch will not stop the motion in the event the limit is hit, possibly resulting in damage to the machine.

Abort Cushions lim_step=# Set # to number of steps to compress limits after switch hit esc_step=# Set # to number of steps to move after Escape key pushed

Some machines may be damaged if stopped suddenly at higher speeds. Abort cushions provide a method of deceleratiing quickly but not instantly when a limit is hit or the escape button is pushed. lim_step specifies the number of steps to continue after a limit is hit. This number must be calculated from the distance your switches may be compressed without damage and the lowest axis resolution of your machine. For instance if your X and Y resolution are 1018.592, your Z and W resolution are 2000 and your limit switches may be compressed .1” then you would set lim_step as follows: lim_step=1018.592*.1=100 steps esc_step may be set to any value that results in a quick stop without moving to far. 200 is suggested.

Users Guide 1 - 3 CNC Controller Installation

Initial Velocities: Initial Velocities may be specified separately for the XY, Z, W, U, and V velocities. Note that X and Y velocities are always the same, so only X velocities should be specified. Maximum, Feed, and Rapid Velocities may be specified for each axis. If you specify a maximum velocity then the axis velocity will be limited to that maximum. Velocity Locks may be set for Rapid and Feed Velocities for each axis. Two types of Velocity Locks are available. Velocity Lock=0 F# specifier on a Gcode line will change the default velocity. Velocity Lock=1 F# will cause the current Gcode line to be run at the rate specified but will not change the default velocity. Velocity Lock=2 F# is ignored. The line is run at the default velocity.

It can be useful to use lock type 2 for rapid velocities. This will insure that rapid moves are always done at speeds compaitble with your machine. However if and part programs use G0 moves while cutting (not a recommended practice) and specify lower speeds for G0 moves then rapid_lock=2 will result in bit breakage or worse. max=# Maximum allowed velocity for axis feed=# Initial feed velocity for axis rapid=# Initial rapid velocity for axis feed_lock Velocity Lock type (line may be ommited for type=0) rapid_lock Velocity Lock type (line may be ommited for type=0)

Arc Feed rates may be set to Automatic Mode or set to an initial rate. In Automatic Mode arcs are run at the current XY feed velocity unless the radius is too small to support that velocity, in which case the maximum arc velocity is calculated based on the acceleration settings for the X and Y axises. Arc Feed rate may also be locked as above. Smoothest motion is usually obtained using Auto mode, arcfeed=# 0 for Auto Mode or velocity desired arc_feed_lock=# 0,1, or 2 as above

Users Guide 1 - 4 CNC Controller Program Operation

CNC Controller has advanced features to provide the smoothest possible cuts. G-Code input is constantly buffered to ‘vector match’ moves. This means it only slows down when it needs to and then only as much as needed to stay within the acceleration parameters programmed. CNC Controller also does incremental acceleration through arcs and matches arc tangential velocities with straight moves to provide smooth arc moves. The result of these features is simply smoother cuts and less need for finish operations. CNC Controller has a user friendly interface that lets you take control of your machine providing features previously only found on custom industrial controllers.

Run the program by typing ‘RUN’ from the CNC directory. Do not run from Microsoft Windows 3.1. Program options may be selected from the pull down menu using the mouse, alt + menukey, or function keys while the machine is stopped.

When the machine is moving only the ESC and SPACE keys are active.

Mode:

F1 Command Selects Command Mode. In Command Mode the controller looks for a file with the name entered and runs it if found. Otherwise it trys to run the command entered as a Gcode command.

See Command Reference for codes supported.

SPACE will pause a running file. ESC will abort a running file. Pause and Abort features should not be used in place of a hardware Emergency Stop and must not be relied upon to stop the machine in an emergency

Restart If F1 is held down mode is changed to Restart. Restart is used to skip through a progam file and run from a specified line.

After a file name is entered the Skip To: prompt is displayed. Enter the line number desired and push ENTER to start the file.

If it is necessary to stop a file and restart:

Push Pause to stop the file. Note the program line number displayed. Push ESC to abort the run. Execute any commands needed. Move back to the start position for the previous run. (@START will work) Adjust the exact starting position if necessary and reset G92 if needed. Push and hold F1 for Restart Enter File Name and Skip To Line

Restart is not available in Level 1

Users Guide 2 - 1 CNC Controller Program Operation

F2 Simulate Checks file name entered for syntax. Displays a simulation report if file is completed without error: Simulate is not available in CNC Level 1.

Simulation report displays:

Estimated run time Estimated time needed to run the simulated file. This feature may be disabled using from CNC.INI or the Settings Menu to speed up simulation on slower PC’s. Start Axis positions and Workspace mode at start of program. End Axis positions and Workspace mode at end of program. Work Coord Min Minimum position reached for each axis expressed in Workspace Coordinates. Displays in red if Boundaries were exceeded. Work Coord Max Maximum position reached for each axis expressed in Workspace Coordinates. Displays in red if Boundaries were exceeded. Absolute Coord Min Minimum position reached for each axis expressed in Absolute Coordinates. Displays in red if Soft Limits were exceeded. Absolute Coord Max Maximum position reached for each axis expressed in Absolute Coordinates. Displays in red if Soft Limits were exceeded.

F3 Edit Edit mode runs the MS-DOS editor. A file name may be entered or selected from the File Finder. This feature is onlyavailable if CNC Controller is started by the RUN.BAT file. Edit Mode is not available in CNC Level 1.

Jog/Transit:

F4 Transit Select Transit Mode. In Transit Mode the machine moves continuously while a key is held down. When F4 is pushed transit speed is set to rapid. Holding F4 down will change transit speed to slow. You must allow room for deceleration after is released since the head will continue to move until it decelerates to a stop. If a limit switch is encountered or the is pushed the move will be stopped without deceleration. Soft Limits and Boundaries are not checked while in Transit Mode. Transit Mode is not available in CNC Level 1.

Machine may be transitted as follows:

Left/Right Arrows Move X Up/Down Arrows Move Y PageUp/PageDown Move Z or U (based on current Scroll Lock) Home/End Move W or V (based on current Scroll Lock) Esc Abort Current Transit Move if Moving

F5 Jog .001 Sets Jog Distance. Machine may be jogged as follows: F6 Jog .01 F7 Jog .1 Left/Right Arrows Move X F8 Jog 1 Up/Down Arrows Move Y PageUp/PageDown Move Z or U Home/End Move W or V Scroll Lock Toggle Between ZW and UV Jogs Light Off For ZW On for UV

Users Guide 2 - 2 CNC Controller Program Operation

Macro Keys

F9 4 custom macros may be assigned to function keys 9-11 F10 Macros are assigned in CNC2.INI: F11 F12 Example: f9=g90 f10=g91 f11=g92.2z-.01 f12=g92.2z.01

Settings:

Soft Limits Toggle Soft Limit Checking. Not Available in CNC Level 1.

Boundaries Toggle Boundary Checking. Not Available in CNC Level 1.

Default Limits Set Boundaries To CNC2.INI default values. Not Available in CNC Level 1.

Estimate Time Toggle cutting time calculation for Simulate Mode. Not Available in CNC Level 1.

Auto Simulate Toggle Auto Simulate Auto Simulate checks each file for syntax, soft limits, and boundaries before running. If there are errors the file is not run. Not Available in CNC Level 1.

Exit:

Exit Exit To Dos. Push X ENTER at any time to exit.

Other Keys:

A-Z 0-9 .- Type in the command or file name to be executed

TAB Repeat the last command or program entered

ENTER Execute current file or command If Enter is pushed from Command, Simulate, or Edit mode File Finder is loaded. File Finder allows individual file selection using mouse or keyboard.

Keys Active While Running:

ESC Aborts current move when running. NOT A SUBSTITUTE FOR EMERGENCY STOP! When ESC is pressed when the machine is moving it is likely that the displayed position will no longer be precisely accurate since stepper motors will miss steps if not decelerated properly. The machine should be homed again before proceeding.

SPACE Toggles Pause Mode when running. Push ENTER to continue. Go to Pause Mode before aborting with ESC to avoid stalling stepper motors and to keep from jolting the machine.

Users Guide 2 - 3 CNC Controller Program Operation

Homeing the Machine:

When CNC Controller is started the display is set to the last known position. If the machine has been moved manually or can drift while powered down this position will not be accurate. The G28 command must be used to home the machine. G28 moves the WZ motors up to the hi limits, then moves the XY motors to their low limits. The heads are then moved away from the limits by the values specified in CNC2.INI and each axis is set to zero. This position is Machine Zero.

It is important to use G28 to set Machine Zero since many CNC Controller features are calculated from this position. Soft Limits, Boundaries, @MZ, @LZ, and @RETRACT cannot be used if Machine Zero is not properly set.

G28 will search for the limits at the G28_XYSRCH and G28_WZSRCH speed specified in CNC2.INI or at 50” per minute if search speeds are not specified. Increasing the search speeds may result in damage to your machine. The lim_step setting in CNC.INI can help minimize the impact to the machine when stopping at the limit switches.

G28 can also be used to home only specified axis’s. (ie. G28Z homes only the Z axis)

Normal machine operation using CNC Controller would be to:

Start the program Enter G28. Push Enter (Machine Goes Home) Enter Name of Part Program To Be Cut

Alternately, you may write your own home program using the M28, M29, and L28 codes. M29 added to any G0 or G1 command will keep the program from aborting when a limit is hit. Instead the current gcode line will be aborted but the next program line will be run normally. When a limit is hit the machine will decelerate using the lim_step value in CNC.INI for limit cushions.

M28 is used to get an accurate measurement of limit switch position for the purposes of homeing the machine. M28 added to any G0 or G1 command will keep the program from aborting when a limit is hit. The limited axis will stop moving, but other axises will continue movement until they hit a limit or finish their move. It is imperative that any line with M28 be run slowly since the limit cushions are not active and the head will stop immediately, which can cause damage if running to fast.

L28 sets absolute position and is used to set the current position to the values specified. Use L28 only to set Machine Zero in your custom home program. Many commands use this absolute position as a reference for movement. Use G92 to set Local Machine Zeros for running parts programmed in G90 mode.

Sample Home File: (Homes the machine and leaves the head .1” from limits)

G91 G1 Z20 W20 M29 F50 G1 Z20 M29 F50 G1 W20 M29 F50 G1 X-200 Y-200 M29 F50 G1 X-200 M29 F50 G1 Y-200 M29 F50 G0 X.5 Y.5 Z.-5 W.-5 G1 X-1 Y-1 Z1 W1 F5 M28 F10 G0 X.1 Y.1 Z-.1 W-.1 L28 X0 Y0 Z0 W0

Users Guide 2 - 4 CNC Controller Program Operation

Coordinate System:

The Machine Zero (MZ) set by homeing the machine becomes the anchor point for all positions specified in subsequent G Code commands.

The position display box displays the current axis coordinates and the axis coordinate modes. The axis coordinate mode is displayed to the right of the axis position.

MZ Coordinates Values are relative to MZ ñ G92 Coordinates Valuse are relative to LZ specified by G92 ò G55, G56, G57 Coords for XY XY values are offset for W,U, or V head G43 Coords for WZUV ZWUV values are offset for M37 values ô G92 and G55,G56, G57, G43 Values are offset for both

The coordinate modes show how the axis values in a given G code command will be interpreted.

G Code commands specify coordinates that specify either distances to be moved or positions to be moved to.

G91 Mode:

G91 mode is called relative or incremental mode. In G91 mode values specify distances. For instance if the X position is currently 20 and G0 X8 is specified the machine would move +8 inches in X to X28.

A G Code program written in G91 mode may be run from any position. Since the moves are relative, the starting position does not matter, the program will run properly from any starting position. However to get the proper results the machine must be set to the proper position in relation to the workpiece before the piece is run.

The axis coordinate status does not have any effect on how the program runs. It does however effect the coordinate display while the program runs.

G90 Mode:

G90 mode is called absolute mode. In G90 mode values specify positions. If the X position is 20 and G0 X8 is specified the machine would move -12 inches in X to X8.

In G90 mode the situation is different. The initial position of the machine will not affect where the part runs since the first move will go to the absolute position specified on the table. Instead of setting the machine position properly before running, as for the G91 program, the machine coordinates must be set properly before running a G90 program.

The G92 commands are used to change the coordinate system so that any position may be temporarily made to be Local Zero (LZ).

Users Guide 2 - 5 CNC Controller Program Operation

G90 Mode (continued)

Most G90 programs are written relative to a starting position of X0Y0 with Z0W0 being either the bottom or top of the workpiece. All that is then necessary to run the program is to insure that the current LZ is set to match the program before running. There are several ways to do this.

The machine maybe positioned to the proper position and the G92 command used to set the proper coordinates for running.

For Example:

The workpiece is fixtured at X20Y20, is 1” thick and Z0 in the part file refers to the top of the workpiece:

G90 Commands in G90 Mode G92 Turn off any current G92’s G0Z2 Set Z 2” above the table - 1” above the workpiece G0X20Y20 Go to corner of workpiece G92X0Y0Z1 Set this position to be 1” above LZ

The coordinate display shows X 0.000 ñ Y 0.000 ñ Z 1.000 ñ

Alternately LZ may be set by shifting MZ the desired amount using G92.1 Using G92.1 it is not necessary to move to the workpiece first.

G90 Commands in G90 mode G92.1X20Y20Z1 Move LZ 20” in XY and 1” above the table

The coordinate display shows the current position relative to the workpiece.

When writing a G Code program there must always be a starting point. Typically it would be the lower left corner (in XY) of the piece to be machined and either the upper or lower surface of the workpiece or a position a known distance above the workpiece (ZW). In a G91 mode program this point does not need to be given a coordinate value. In G90 mode this point is assigned a coordinate value (usually 0,0,0) and all positions are specified relative to this starting point.

When running the program the machine is positioned to this starting point and G92 is used to set this position to the start position for the program. Alternately G92.1 may be used to shift MZ

Users Guide 2 - 6 CNC Controller Program Operation

Workspace:

G54 G55 G56 and G57 are used to shift the XY position so that the Z, W, U, or V heads may be used to cut a given part. The distance from the Z head to each of the other heads must be measured and set in CNC2.INI before using the workspace commands.

For example:

The X distance from the Z head to the W head in X is +7.3” and there is no difference in Y

Enter G55=X7.3Y0 in CNC2.INI

Commanding G55 will then move X -7.3” resulting in the W head being at the same position as the Z head before the G55 command was given.

The G56 and G57 commands function in the same fashion for machines with more than 2 heads

Head Swap:

L12 provide a means of cutting with a head not specified within a program and of using multiple heads simultaneously.

For example:

L12WZ moves Z whenever W is specified and moves W when Z is specified.

L12 ZZ moves Z and W together whenever Z is specified.

L12 alone or L12ZW sets normal operation

Tool Length Offset

M37 is used to measure tool length and set ZWUV workspace.

By using M37 it is not necessary to measure tool length for every workpiece thickness change. Using M37 in combination with Soft Limits and Boundaries also provides a means of protecting then table from being routed accidentally. After M37 is set G28 will set the ZW coordinates to the actual position of the tool tip above the table.

For example:

Move the Z head tool tip to the table. Command M37 Z0

M37 turns on G43 mode, indicating that tool length offsets are active. Tool length offsets can be disabled using G49 and re-enabled with G43 without re-measuring.

Users Guide 2 - 7 CNC Controller Program Operation

Soft Limits and Boundaries

Soft Limits are used to keep programs and command from moving into the limit switches. Values must be set in CNC2.INI before using.

lolim=X#Y# distance from MZ to XY lo limit switches less .1” hilim=X#Y#Z#W# distance from MZ to XYZW hi limit switches less .1”

ZW lo limits should not be specified since desired positions vary with tool length.

lobound=X#Y#Z#W# distance from MZ to XY table edge and top hibound=X#Y# distance from MZ to XY table edge

ZW hi boundaries should not be specified since desired positions vary with tool length.

Soft Limits check absolute positions command against the limit switch positions. If a position is commanded that would result in a limit switch being hit an limit error will be displayed and the move will not be run.

Boundaries check workspace positions. In G54 mode the Z head will not be allowed to leave the table. In G55 mode the Z head might move off the table but the W head will be kept on the table.

ZW lo boundary checking is available if M37 is used. Use M37 to set Z0W0 to the table top. Set ZW hi limits and lo boundaries are then both set to 0. This allows movement between the limits and the table.

Limits and Boundaries may be enabled or disabled in the Settings Menu and in CNC2.INI using softlim=0 or 1 and boundary=0 or 1.

Auto Simulate

Auto Simulate checks every file before it is run to insure it is within Limits and Boundaries and that it has no syntax errors. Using Auto Simulate eliminates Syntax Error, Boundary, and Soft Limit aborts while cutting. It also provides a line status display showing current line/total lines while the program is run.

Batch Mode:

A program file may be run automatically from the DOS prompt or a batch file by specifying:

cnc /r= where is the name of the file to be cut. CAUTION!! The machine will start automatically when batch mode is used. If the file is completed successfully the program will be exited at the end of the run, otherwise the error code which stopped the run will be displayed. If running from a batch file, remember that the other batch file commands will run automatically when the program is manually exited.

It is recommended that you do not use batch mode.

Instead use the M98 subprogram call command. This command will let you run several programs from one file. Using the M5 dwell without specifying a dwell you can pause the program and prompt the operator. These commands will allow all the functionality of batch mode without leaving the program.

Repeat Command:

The last command or file name entered may be repeated by pushing the . Then push ENTER to run the repeated command.

Users Guide 2 - 8 CNC Controller Program Operation

Keypad:

CNC Controller Level 3 and above includes a keypad to allow transit and jog of the machine from up to 20 feet from the computer. Plug the keypad into the COM2: port on your computer or change settings in CNC2.INI to select another available com port.

Active keys on the keypad:

Abort Abort move Pause Pause move Rpt Repeat Last Program

.001” Select Transit Mode .01” Select Jog .01” .1” Select Jog .1” 1” Select Jog 1”

Trns Select Transit Mode

Left Arrow Move X Right Arrow Up Arrow Move Y Down Arrow

PgUp Move Z or U PgDwn

Home Move W or V End

*3 Toggle Between ZW and UV mode

Users Guide 2 - 9 CNC Controller Command Reference

Command Reference:

Parameters in [Brackets] are optional. Level 1 commands are available in all versions. Level 2 commands are available only in CNC Controller Level 2.

Values:

XYZWIJ Axis Specification Axis values are specified with decimal point. [X#] [Y#] [Z#] etc. A value with no decimal is read as an integer value. Level 1 No value is equivalent to specifying 0. Example: XYZ is equivalent to X0Y0Z0.

F Feed Velocity Velocity is stored separately for Linear XY, Linear ZW. and F# Arc’s Rapid and Feed Velocity is stored separately Level 1 for Linear Moves Independent velocities are stored based on the XYZW specified in the line containing the F# command. Velocity is specified in inches per minute. Example: F60 sets XY Feed Velocity to 60. G1 X F60 sets XY Feed Velocity to 60. G0 X1 Y1 Z1 F60 sets XY and ZW Rapid Velocity to 60. G2 X2 F60 sets arc feed rate to 60. Specifying F# alone on a line sets XY Feed Velocity

[ Comment Used to add comments to programs. A closing bracket is optional. Example: [This is a comment] G0 X10 Y10 [This is too] G Codes:

G0 Rapid Move Moves to the position specified at Rapid velocity. G0 [X#] [Y#] [Z#] [W#] G0 is modal. After a G0 is executed lines with no gcode Level 1 command are executed as a G0. Example: X1Y1 is equivalent to G0 X1Y1 if mode is G0

G1 Feed Move Moves to the position specified at Feed velocity. G1 [X#] [Y#] [Z#] [W#] G1 is modal. After a G1 is executed lines with no gcode Level 1 command are executed as a G1. Example: X1Y1 is equivalent to G1 X1Y1 if mode is G1

G2 Clockwise Arc Moves to the position specified at Feed velocity. G2 [X#] [Y#] [I#] [J#] I is the X distance to the center point. Level 1 J is the Y distance to the center point. If no XY move is specified a full circle is cut. If no I or J is specified previous I J values are kept. ...[Z#] [W#] Helical Interpolation is Supported in Level 2 Only

G3 Counter Clockwise Arc Moves to the position specified at Feed velocity. G3 [X#] [Y#] [I#] [J#] I is the X distance to the center point. Level 1 J is the Y distance to the center point. If no XY move is specified a full circle is cut. If no I or J is specified previous I J values are kept. ...[Z#] [W#] Helical Interpolation is Supported in Level 2 Only User Guide 3- 1 CNC Controller Command Reference

G4 Dwell Stops movement for the time specified by the X value. G4 X# There is no limit to delay time. Level 2 If no time is specified then the machine will be stopped until the operator pushes ENTER. Place a comment after the dwell to prompt the operator. Example: G4 [Ready To Start Section 2] Never use Dwell to stop the machine while changing parts! Instead program a single part and use the TAB key at the Program prompt. This will repeat the last part cut.

G28 Return to machine zero Moves specified Axis’s to Lo Limit for XY - Hi Limit for ZW G28 [X][Y][Z][W] Moves specified Axis’s to CNC2.INI specs from limits. Level 1 Sets all Axis positions to 0. All Axis’s are moved if none are specified.

G43 Tool Length Offset On Sets tool length offsets to the values set by the last M37 G43 [Z][W][U][V] command. Level 2 G43 alone turns all offsets on.

G49 Tool Length Offset Off Cancels tool length offsets. G49 [Z][W][U][V] G49 alone turns all offsets off. Level 2

G54 G54 Workspace Select the Z head. If G54 is commanded from G55, G56, or G57 mode, the Z head will be moved to the current XY position.

G55 G55 Workspace Select the W head. If G55 is commanded from G54, G56, or G57 mode, the W head will be moved to the current XY position.

G56 G56 Workspace Select the U head. If G56 is commanded from G54, G55, or G57 mode, the U head will be moved to the current XY position.

G57 G57 Workspace Select the V head. If G57 is commanded from G54, G55, or G56 mode, the V head will be moved to the current XY position.

G81 Drill Cycle Moves to XY specified at Rapid velocity. G81 [X#] [Y#] [Z#] [W#] Moves to ZW specified at Feed velocity. Level 2 Moves to original ZW at Rapid velocity

G90 Absolute Mode Can be specified with other gcodes on any line. G90 XYZW values from the current line forward are read as Level 1 absolute coordinates. IJ values are always relative to the current XY position, not absolute positions, regardless of G90/G91 mode.

G91 Relative Mode Can be specified with other gcodes on any line. G91 XYZW values from the current line forward are read as Level 1 relative movements from the current position.

User Guide 3- 2 CNC Controller Command Reference

G92 Set Local Coordinates Used to specify a new coordinate system for running G92 [X#] [Y#] [Z#] [W#] absolute mode programs. Level 1 Use G92 alone to restore the Machine Coordinates. Specifying ‘G92 X0 Y0 Z0 W0’ sets the current position to zero. Specifying ‘G92’ then restores the positions to their current Machine Coordinate values.

G92.1 Shift MZ Coordinates Similar to G92 except that the coordinate system produced G92.1 [X#] [Y#] [Z#] [W#] shifts Machine Zero by the amount specified. Level 2 This is useful since a given local coordinate system can be set without positioning the head to a certain position first. Specifying ‘G92 X10 Y10’ sets the absolute position X10 Y10 to X0 Y0 in local coordinates. G92.1 may also be used to restore a single axis to absolute coordinates. G92.1 X0 leaves YZW local coordinates but sets X back to absolute coordinates.

G92.2 Shift LZ Coordinates Similar to G92.1 except that the coordinate system shift G92.2 [X#] [Y#] [Z#] [W#] is added to the current Local Coordinates instead Level 2 of replacing them. This is useful for ‘jogging’ a local position. If the Z head has been set for running a G90 mode file but then needs to set to cut .010” deeper G92.2Z-.01 will accomplish this with a single command. Can be useful as a macro assigned to F9-F12.

User Guide 3- 3 CNC Controller Command Reference

L Codes:

L0 Ignored Ignored commands are not executed but not flagged as errors. L1 Ignored L4 Ignored L5 Ignored

L6 Set Acceleration Set axis accelerations to values specified in min/sec/sec. L6 [X#] [Y#] [Z#] [W#] Accelerations are preset in CNC2.INI and may be changed Level 1 using L1.

L7 Set Arc Feed Rate Set arc feed rate to value specified by X. L7 X# Set to 0 for Auto Arc Feed Mode Level 1

L10 Cut Array Sets up array cutting. Repeats all code following until the end L10 [R#] [C#] [X#] [Y#] of the file or another L10 is reached. Level 2 Code following L10 is run until end of file or another L10. Program pointer is moved back to initial L10. Head is moved to the next column or row specified by XY at Cycle repeats until all array points have been cut. L10 specified without RCXY values can be used to end an array cut. Lines that follow will not be repeated.

L11 Set Axis Mapping Allows remapping of axis inputs. Specify the axis’s that should L11 [X][Y][Z][W] receive the input from XYZW in that order. Level 2 Specify L11 alone to return to normal parsing. For example: L11 XYWZ swaps the W and Z axis. L11 XYZZ move Z and W together.

L12 Set Axis Mapping Allows remapping of axis inputs. Specify the axis’s that should L12 [Z][W] receive the input from ZW in that order. This command works Level 2 like L11 except that the XY inputs are skipped. Specify L12 alone to return to normal parsing. For example: L11 WZ swaps the W and Z axis. L11 ZZ move Z and W together. L13 Ignored L14 Ignored L15 Ignored L16 Ignored

L20 Disable Soft Limits Disable Soft Limit and Boundary Checking L20 Soft limits and Boundaries are used to define a cutting area Level 2 which is checked during parsing of a file or command. This effectively keeps the machine from moving out of a defined area. L20 disables Soft Limit and Boundary checking

L21 Enable Soft Limits Enable Soft Limit and Boundary Checking L21 [X1,X2] L21 X1 enables Boundaries only Level 2 L21 X2 enables Soft Lims only. L21 alone enable both.

L22 Set Lo Boundaries Set Lo Boundaries to values specified. If no values are given L22 [X#] [Y#] [Z#] [W#] then all Lo Boundaries are set to CNC2.INI defaults. Level 2

User Guide 3- 4 CNC Controller Command Reference

L23 Set Hi Boundaries Set Hi Boundaries to values specified. If no values are given L23 [X#] [Y#] [Z#] [W#] then all Hi Boundaries are set to CNC2.INI defaults. Level 2

L28 Set Position Sets Machine Coordinates. Machine Coordinates specify the L28 [X#] [Y#] [Z#] [W#] fixed machine zero point for your machine. Level 1 L28 is normally used only to write a custom homing program. L28 does not move the machine, but sets the current position to the values specified. Use G92 to set a local coordinate system for running absolute mode programs from any table position.

L33 Ignored L55 Ignored

L90 One Time Absolute L90 is used in a command to specify G90 coordinates on one line without changing program mode to G90.

L91 One Time Relative L91 is used in a command to specify G91 coordinates on one line without changing program mode to G91.

L92 Cancel G92 Restore The current G92 Local Coordinate system is saved every L92 time a program is started or a sub-program is called using Level 1 M98. When the program is finished the original G92 Local Coordinate system is restored. This is not desirable if the program is being used to preset a system configuration for other programs. L92 causes the normal G92 Coordinate restore to be skipped after the program containing the L92 is finished.

L100 Toggle G00/G01 Useful as a macro for F9-F11

L101 Toggle G90/G91 Useful as a macro for F9-F11.

User Guide 3- 5 CNC Controller Command Reference

M Codes:

M1 Auxiliary Output Controls auxiliary outputs. If # is non-zero output is turned on M1 [X#][Y#][Z#][W#] otherwise output is turned off. Level 2 Port and bit addresses are setup in CNC2.INI. X=aux1 Y=aux3 Z=aux5 W=aux7 DO NOT USE Auxiliary Outputs To Start Cutting Spindles!

M2 Auxiliary Output Controls auxiliary outputs. If # is non-zero output is turned on M2 [X#][Y#][Z#][W#] otherwise output is turned off. Level 2 Port and bit addresses are setup in CNC2.INI. X=aux2 Y=aux4 Z=aux6 W=aux8 DO NOT USE Auxiliary Outputs To Start Cutting Spindles!

M3 Set Home Position Stores current position of each axis specified. Values specified M3 [X][Y][Z][W] are ignored. Level 2

M4 Return To Home Moves each axis specified to the last M3 position stored. M3 [X][Y][Z][W] Values specified are ignored. Level 2 Example: M3 ZW Return Z and W axis to M3 position.

M5 Dwell Stops movement for the time specified by the X value. M5 X# There is no limit to delay time. Level 2 If no time is specified then the machine will be stopped until the operator pushes ENTER. Place a comment after the dwell to prompt the operator. Example: M5 [Ready To Start Section 2] Never use Dwell to stop the machine while changing parts! Instead program a single part and use the TAB key at the Program prompt. This will repeat the last part cut.

M11 Auxiliary Output On Controls auxiliary outputs. Channel specified by # is turned on. M11 C# Port and bit addresses are setup in CNC2.INI. Level 2 DO NOT USE Auxiliary Outputs To Start Cutting Spindles!

M12 Auxiliary Output Off Controls auxiliary outputs. Channel specified by # is turned off M12 C# Port and bit addresses are setup in CNC2.INI. Level 2 DO NOT USE Auxiliary Outputs To Start Cutting Spindles!

M28 Disable Limit Abort M28 is used to write your own home program instead of using G28 to home the machine. CNC Controller normally aborts a program when a limit switch is encountered. Adding M28 to a G0 or G1 command disables the program abort and instead stops the limited axis while allowing other axis’s to continue. Limit Cushions are disabled while using M28 so any move done with M28 should be done slowly to avoid machine damage. M28 must be specified on each line separately.

User Guide 3- 6 CNC Controller Command Reference

M29 Disable Limit Abort M29 is used to write your own home program instead of using G28 to home the machine. CNC Controller normally aborts a program when a limit switch is encountered. Adding M29 to a G0 or G1 command disables the program abort and instead stops the current Gcode line but continues on the following line. M29 must be specified on each line separately.

M37 Measure Tool M37 is used to set Tool Length Offsets. M37 [Z#][W#][U#][V#] The end of the tool is first set to a known position. M37 is then specified to set the tool length offset.

For example: Jog the Z head to the spoilboard. Enter M37Z0 to set the Z work coordinate to 0

Once Tool Length Offsets are set Boundaries may be used to insure that the table is not routed by accident. Normally zero values are set to the top of the spoilboard. Use G92 to set material thickness if programs reference zero from top of material. This eliminates re-measuring tools for different thickness materials. G43 and G49 are used to enable and disable offsets.

M98 Subprogram Call Run a subprogram. A subprogram may be any gcode file. M98 Control is passed back to the calling program when finished. To run a G90 mode subprogram from any position on the table use G92X#Y#Z#W# to set the local coordinates at the beginning of the file.

User Guide 3- 7 CNC Controller Command Reference

@ Commands:

@MZ Go To Machine Zero Moves at Rapid Rate to Machine Zero set by G28 or L28 Level 2 ZWUV moves to MZ position. XY moves to MZ position.

@LZ Go To Local Zero Moves at Rapid Rate To Local Zero set by G92 Level 2 ZWUV moves to MZ positions. XY moves to LZ positions

@START GoTo Program Start Moves To Start Position of Last Program Run. @ST Level 2 ZWUV moves to MZ positions. XY moves to Program Start ZWUV moves to Program Start

@RETRACT Go To Retract Lifts heads to absolute zeros or to value specified @RT in CNC2.INI

User Guide 3- 8 CNC Controller System Configuration

CAUTION!! Make sure you have some idea of what your doing before changing CNC2.INI. All input and output is controlled by these settings. Improper settings will cause limit switches to not work, wrong axis movement in the wrong directions, and / or other bad and potentially dangerous or damaging misoperation.

Please call for help instead of experimenting if you are not very familiar with motion control concepts and computer configuration.

Use a text editor (such as EDIT.COM) to edit CNC2.INI. Change values for parameters as specified below. CNC2.INI is read every time the program is started. Make sure the file gets saved as ASCII text (without formatting).

Axis:

axis number of axis’s on machine pulse_12 pulse width for port 0x278 1=short 2=medium 3=long pulse_34 pulse width for port 0x378 pulse_56 pulse width for port 0x3BC stepdiv set pulse accuracy. use 4 for 486dx 66mhz and faster. 2 or 0 for slower cpu’s

Channel:

xchan port channel for axis = 1 to 6 where is x,y,z,w,u, or v _dir_pos value of dir_bit (0 or 1) only needed if an axis runs backwards (set to 0 to change) res resolution for x axis (steps/unit) vchg maximum instantaneous velocity change (steps/sec) acc acceleration for axis (steps/sec/sec)

Limits: these settings are not needed unless your limit switches work backwards place after the chan setting if needed

_lo_val value of input bit which corresponds to limit ‘closed’ (0 or 1) toggle it if limit works but display is backwards _hi_val value of input bit which corresponds to limit ‘closed’ (0 or 1) toggle it if limit works but display is backwards

Velocity:

max maximum axis velocity (units/minute) feed axis feed velocity for G1 (units/minute) rapid axis rapid velocity for G0 (units/minute) feed_lock 0,1, or 2 rapid_lock 0,1, or 2 arcfeed arc feed rate for G2, G3 (0 = auto mode) arcfeed_lock 0,1, or 2 secinch feedrate limit for seconds/inch some nc drivers specify feedrates in inch/sec. this value sets a lower limit for entries of this type. for example if secinch=10 then entering f2 results in feedrate being set to 2 ips (120 ipm) but f11 sets feedrate to 11 ipm. set to 0 to force all entries to ipm or to 1000 to force all entries to ips.

User Guide 4 - 1 CNC Controller System Configuration

G28 Settings:

g28 x#y#z#w# machine zero distance from switches (units) set to 9999 for axis’s that should not be homed g28_dist search distance to switches g28_rele release distance after switch closure g28_xysrch velocity for xy axis search for switches (units/min) g28_zwsrch velocity for zwuv axis search for switches (units/min) g28_touch velocity for slow calibration (units/min)

Auxiliary Outputs:

aux<#>_port port number of auxoutput 1 - 8 (0 or 1) aux<#>_bit bit of port to control for aux output 1 - 8 (0-7) aux<#>_off value of bit when aux output is off (0 or 1)

Soft Limits:

lolim X#Y# lo limit values hilim X#Y#Z#W# hi limit values lobound X#Y#Z#W# lo boundary values hibound X#Y# hi boundary values softlim 0=disable 1=enable soft limit checking boundary 0=disable 1=enable boundary checking autosim 0=disable 1=enable auto simulate

Arc Settings:

arc_err value (in inches) of allowable errors in arc specifications. Default value is .01. If you get radius errors from your files increase in .002 steps. If errors persist the problem with larger values the problem is probably in your program. Arc Radius errors indicate that the distance from the start point to the center point is not the same as the distance from the end point to the center point.

arc_min value (in inches) for smallest arc radius to be cut as an arc. Arcs with radius smaller than this value will be cut as a G1 move. Default value is .002.

arc_tol value (in steps) for full circle. If the distance from the start point to the end point (in steps) is less than arc_tol then a full circle will be cut. default value is 3 steps.

Workspace:

g55 x#y# distances from Z head to W head g56 x#y# distances from Z head to U head g57 x#y# distances from Z head to V head

retract z#w#u#v# specify heads to retract with @ commands

Data Path:

dir program directory if \cnc path default data path for program files and wildcard for FileFinder ie. path=c:\cnc\data\*.tap

User Guide 4 - 2 CNC Controller System Configuration

KeyPad Settings:

key_port address of COM port for keypad key_irq interrupt setting for keypad COM1 is 0x3F8,irq=4 COM2 is 0x2F8,irq=3 *default COM3 is 0x3E8,irq=4 COM4 is 0x2Ef8,irq=3

Ports Settings: These settings are only used for non lpt port installations

addr_0 base address of 1st port addr_1 base address of 2nd port out_addr_0 base address of 1st port if not using printer cards out_addr_1 base address of 2nd port if not using printer cards in_addr_0 address of limit inputs for port 0 if not using printer cards in_addr_1 address of limit inputs for port 1 if not using printer cards _port assigns x to port 0 or 1 _lo_bit bit of in_addr for axis lo limit switch (0-7) _hi_bit bit of in_addr for axis hi limit switch (0-7) x_step_bit bit of out_addr to pulse to step the x motor. (0-7) x_dir_bit bit of out_addr to control direction for x motor (0-7)

User Guide 4 - 3 CNC Controller Error Codes

Error Codes:

Line too long Input line more than 80 characters

Unsupported G Code G Code in input line which is not supported.

Unsupported L Code L Code in input line which is not supported or ignored.

Unsupported M Code M Code in input line which is not supported.

Multiple Commands Input Line contains more than 1 command.

Syntax Non-supported code entered

Target Error Indexer did not reach programmed point. Contact Microsystems.

Arc Radius Distance from startpoint to center is not equal to distance from endpoint to center. Arc Radius errors can occur from running a G2 or G3 intended for G91 mode in G90 mode and visa versa.

Soft Limit Exceeded Move specified would result in the head being moved outside the soft limits.

Boundary Exceeded Move specified would result in the head being moved outside the workspace boundaries.

Acceleration Out Of Bounds Acceleration Rate Too High For Resolution Maximum acc*res in steps is 65535

Abort - Limit Limit switch encountered while running

Abort - Esc Escape button pushed while running

User Guide 5- 1 CNC Controller Error Codes

User Guide 5- 2 CNC Controller Version 2.01.23 CNC2.INI Changes

Port specifications:

The default port addresses for motion using lpt cards are:

Port 0 0x278 Port 1 0x378 Port 2 0x3BC

These may be changed using:

portout=#,address # is the port number (0,1, or 2) Address is the new base port address (ie. 0x300)

Portout is also used to specify additional ports which will be used for auxiliary outputs. Port #’s 4, 5, 6, 7 are available for additional auxiliary outputs. Note that port 3 cannot be used.

Portin is used to specify auxiliary input ports. Ports 4, 5, 6, and 7 are available for auxiliary inputs.

portin=#,address # is the port number (4,5,6, or 7) Address is the input port address

Axisspec may be used instead of the older Xchan, Xres, Xacc specs.

axisspec=c#p#s#d#r#a#e#o# c# specifies a channel number for the axis If c# is used p# s# and d# must not be used c1 is equivalent to p0 s0 d1 c2 is equivalent to p0 s4 d5 c3 is equivalent to p1 s0 d1 c4 is equivalent to p1 s4 d5 c5 is equivalent to p2 s0 d1 c6 is equivalent to p2 s4 d5 p# specifies an output port # for the axis (0,1,or 2) s# specifies the bit for the step signal (0-7) d# specifies the bit for the direction signal (0-7) r# specifies the resolution in steps per inch a# specifies the acceleration in inches/minute/sec o1 changes the polarity of the direction signal e1 sets the step signal for negative edge triggered drives

Axislo is used if the channel specs are not used in the preceding Axisspec or if the lo limit switch is non-standard for channel specs. Axislo is not needed if standard channel specs are used in preceding Axisspec line.

axislo=p# b# o# p# specifies the input port for the limit switch (0-3) b# specifies the bit on the port (0-7) o# sets the switch polarity (0 or 1) Axishi is used if the channel specs are not used in the preceding Axisspec or if the hi limit switch is non-standard for channel specs. Axislo is not needed if standard channel specs are used in preceding Axisspec line.

axislo=p# b# o# p# specifies the input port for the limit switch b# specifies the bit on the port o# sets the switch polarity (0 or 1)

Auxout is used to specify an auxiliary input

auxout=c#p#b#o#d# c# is the channel number (1 – 32) Channel numbers should not be skipped p# is the port number and refers to a port specified in a portin spec b# is the bit number (0 – 7) o# changes the output polarity when specified as o1

Auxin is used to specify an auxiliary input

auxin=c#p#b#o#d# c# is the channel number (1 – 32) Channel numbers should not be skipped p# is the port number and refers to a port specified in a portin spec b# is the bit number (0 – 7) o# changes the input polarity when specified as o1 d# specifies debounce. When the input is a switch, debounce should be used. d100 is a typical value.

Signal is used to setup control pushbuttons. First setup an auxin line for the input. Then specify signal as follows to use the input channel as a control signal.

Signal=c# t# c# specifies the input channel to be used for the signal t# specifies the signal type t101 Pause/Continue t102 Pause t103 Continue t110 Start Cycle LPT Card Pinouts

Base Port (ie. 0x278) 8 outputs

Bit Pin on DB25 0 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9

Base Port+1 (ie. 0x279) 4 inputs

Bit Pin on DB25 4 13 5 12 6 10 7 11

Base Port+2 (ie. 0x27a) 4 inputs or outputs

Bit Pin on DB25 0 1 1 14 2 16 3 17 To add a start cycle switch to an older cnc2.ini:

Delete all the current aux lines

Add the following lines:

Portin=4,0x??? (this may be 0x279,0x379,0x3bd)

Auxin=c1p4b#o# (bit will be either 4,5,6, or 7 – see pinouts above) (o# will be 0 or 1) Signal=c1 t110

The inputs will be displayed in the lower right hand window on cnc20123.exe

You will see a single grey dot. When you push the button the dot should get bigger and turn yellow.

If nothing happens the the bit or port setting is wrong, or the switch is not wired in.

If the dot starts yellow but turns grey when you push the button then change the o# in the auxin line

CNC Controller Tool Length Measure

Requirements:

CNC Controller 2.01.13 or higher.

If you have an earlier version the newest exe file can be obtained at our ftp site:

ftp://ftp.msys.net/cnc

Select the beta directory and download the cnc20???.exe file. Copy this file to your \cnc directory and name it cnc2.exe

Level 3

If you have a Level 1 or Level 2 system contact Microsystems for an upgrade.

Switch Position

A single pole switch must be mounted on the table at a location that can be reached by each spidle to be measured. The spindles must be able to be centered above the switch without x or y limit switches being contacted.

Switch Wiring

The switch should be wired in parallel with the lo limit switches for each axis to be measured. When wired properly each the lo limit for each measured axis will be ‘on’ when the measure switch is depressed.

Configuration

Copy the included G37 files into the \cnc directory.

G28 the machine

Use commands or transit keys to center the z head above the measure switch

Record the displayed X and Y positions.

Edit the include file TM, changing the X and Y values to the above values. The TM file can then be used to move the Z head to the measure switch.

Transit X and Y to a suitable position to measure the table or spoil board height. With a bit in the Z head transit the head down so that the bit is on the table. Accuracy here is critical.

Run the included file G37CAL. It will lift the Z head, move to the measure switch, lower the Z head until the switch closes, and pause. Record the Z value displayed. Push Enter to continue. Edit the included files ZCAL and WCAL, changing the value on the M37 line to the recorded value.

Operation

Every time a bit is changed, type G37Z (for Z head) or G37W (for W head) to measure the bit length.