{9/22/94 Copied: Fanuc 6M M001.81.2m Created: Black & Decker Router M699.81.2m For: Bureau Graphics Machine: Black & Decker ELU Router Control: Versions: ncCad 4.33/ncCAM 4.33/ncPost 4.33.03/Compost 4.21.22 Changes made per Charles Winston of Bureau Graphics. Does not support multiple G-Code blocks. Does not support ToolChng. Customer indicated that they only program 1 Tool, but NewTool was left in anyway. Does not support Tool Length or Diameter Offsets. Does not support WorkFixtureOffsets. Deleted G17, G18 and G19 commands from Form. Set Use Absolute Arc Centers to TRUE in Compost Boolean Dialog. Changed Preset from G92 to G52 in Compost Commands 1 Dialog. Changed Call Sub from M98 to G37 in Compost Commands 3 Dialog. Comments are output with single quote. Added ASCII('39') at all places except for ToolComment$. ToolTypeComment and ToolComment are only output at FirstOperation and NewTool. Customer requested use of ToolComment for ' G32' SubCall of SetUp Routine. Added Address Spaces. Line Numbers are output without an Address. Deleted all Seq and SeqC commands. Added SetLineStrtChr('?'), SetLineStrtChr('') and Retag. Added conditions to toggle between SetLineStrtChr('') and SetLineStrtChr('?'). Does not support output of any ZMoves. Literal 'G28 Z' represents ZCP1 and is output at beginning of all Operations. Literal 'G28 Z' also represents OfstOff and is output at proper times. Literal ' Z-V10' represents ZIn and ZInPlusInc. Literal ' ZV10' represents ZCP2, ZCP3 and ZCP2PlusInc. Changed coordinate FORMATs to 2 place, non-decimal, leading zero suppression. ArcI#, ArcJ# and ArcR# are also output without an address. ArcR# is output in front of MoveXYC. Changed FeedRate FORMATs to whole integer values with no addresses. Using Variable(1) to store current value of FeedRate. Using Variable(2) to convert FeedRate. Added following subs DoFeed sub outputs correctly scaled value stored. Outputs integer 1 through 9 per linear relationship of FeedRate values 3 to 33. DoFeedEnt stores FeedEntry# and calls DoFeed sub. DoFeedRate stores FeedContour# and calls DoFeed sub. DoArcFeed stores ArcFeed# and calls DoFeed sub. DoDecelFeed stores DecelFeed# and calls DoFeed sub. CkFeedEntC compares stored value to FeedEntry# and calls DoFeedEnt sub. CkFeedRateC compares stored value to FeedContour# and calls DoFeedRate sub. CkArcFeedC compares stored value to ArcFeed# for ConstantSurfaceFeed Operations. ConstantSurfaceFeed Operations call DoArcFeed sub. Non-ConstantSurfaceFeed Operations call CkFeedRateC sub. Changed all M00 and ProgStop commands to literal ' G38 MOTOR OFF'. Moved CRCOnC to FirstOperation, NewTool and SameTool. Moved CRCOffC to NewTool, SameTool and end of Prog. CutterRadiusCompensations is activated prior to EntryMove, and canceled after Tool Retracts. Modified SubCall Routines for Repeat Operations. ' G36 V20' Repeats# stores Loop value into Control Variable. ' G34 V20' Subtracts one from stored value. ' G37 ' BlockNumber performs SubCall. ' G35 V20 ' BlockNumber sends control back to G34 V20 block until Loop is complete. Using same method as L001 Tagging for calling appropriate block numbers. Modified SubCall Routines for MultiplePart Operations. Identicle to Repeat Operations except that Parts# is loop value stored instead of Repeats#. Modified SubCall Routines for AutoCycles and SepSubs. ' G37 ' BlockNumber performs SubCall. Added Segmented Arcs. Customer requested Segmented Arcs whenever radius of Arc is GreaterThan OR Equal to 250mm, or, Center of Arc lies outside table limits from X0.Y0. to X1200.Y1200. Added ArcSegTest sub to test for valid ArcSegment condition. Setting Flag(1) when ArcSegment condition exists. NOTE: Customer requested that chord length of Segment be 1mm to 2mm long. Added various SetArcSegmentAccuracy arguments based on radius of Arc to maintain 1.5mm chord length. Problem exists when radius is greater than 50mm. Minimum value of SetArcSegmentAccuracy argument must be .005% of radius plus .00001. Example: 100mm radius requires argument value of at least .00501, 250mm requires .01251, etc. Added ArcSegReport sub to aid in troubleshooting. Can be deleted when problem is solved either by correcting strange pattern of SetArcSegmentAccuracy argument to radius ratio, or, new command is created allowing Segment to be controlled by length of chord instead of chord height. DWB}
{10/6/94 Modified: Black & Decker Router M699.81.2m For: Bureau Graphics Versions: ncCad 4.33/ncCAM 4.33/ncPost 4.33.03/Compost 4.21.22 Versions: Catalyst v2.05.54C/Compost 4.21.22 Changes made per Charles Winston of Bureau Graphics. Modified handling of Segmented Arcs. Deleted various SetArcSegmentAccuracy arguments at ArcSegTest sub. Bill Gibbs instructed me to allow default value of .025 to control Arc Segmentation. Bill instructed me to calculate Hypoteneous of move and suppress output until a move GTEqual to Num#(1.0) mm is established. Modified ArcSegReport. Added output of additional calculations. Added Hypoteneous sub. Calculates Delta End Point value of current ArcSegmentFeature. Added following variables to accomplish this: Var(3) = Current Tool Position in X axis. Var(4) = Current Tool Position in Y axis. Var(5) = Current Delta X Position. Var(6) = Current Delta Y Position. Var(7) = Current Hypoteneous value. Added ChordLength sub. Outputs valid ArcSegment move GTEqual to Num#(1.0) mm. DWB}
{11/9/94 Modified: Black & Decker Router M699.81.3m For: Bureau Graphics Versions: ncCad 4.33/ncCAM 4.33/ncPost 4.33.03/Compost 4.21.23 Versions: Catalyst v2.14.06C/Compost 4.21.23 Changes made per EMail from Charles Winston of Bureau Graphics. Changed all '#####^#0' FORMATs to '#####.#0;0' in Compost Default Formats Dialog. Addresses affected by this were A, B, C, I, J, K, R, Q, X, Y and Z. Changed all '##0' FORMATs to '###.#0;0' in Compost Default Formats Dialog. Addresses affected by this were F. Changed FORMAT#4 from '####^#0' to '####.#0;0' at Prog Numeric Format Definitions. Changed FORMAT#6 from '###0' to '##0.##;0' at Prog Numeric Format Definitions. Commented out MoveType$ of ProgramComments at FirstOperation. Commented out FileBytesComment, FileFeetComment and FileMetersComment at end of Prog. DWB}
{Prog Numeric Format Definitions *******************************************}
RestoreScale: IF NOT Metric? {CAM file is in English, tools and tool path} SetScale('25.4') { change to Metric, this is a Metric post} END RETURN
DoSubComment: IF UseComments? AND SubComment? ASCII('39') 'SUB NUMBER: ' Program# END RETURN
DoOpComments: IF UseComments? SetScale('1') SetLineStrtChr('') ASCII('39') '-------------' EOL IF OperationIDComment? ASCII('39') 'OPERATION ' Operation# ': ' OperationType$ EOL END IF OperationComment? ASCII('39') OperationComment$ EOL END IF WorkGroupComment? ASCII('39') WorkGroupComment$ EOL END IF FirstOperation? OR NewTool? IF ToolTypeComment? ASCII('39') 'TOOL ' Tool# ': ' ToolDiameter# ' ' ToolType$ EOL END IF ToolComment? '? G32 ' ToolComment$ EOL { Calls SetUp Routine } END ELSE IF LAST ProgStop? IF ToolComment? '? G32 ' ToolComment$ EOL { Calls SetUp Routine } END END END RestoreScale SetLineStrtChr('?') END RETURN
PSInit: {reset flags} RotateF RETURN
PSStuff: {revised.72} IF FourthCW? FORMAT(FourthDegree#,2) ' A' FourthDegree# EOL FourthCWF {reset flag} END IF FourthCCW? FORMAT(FourthDegree#,3) ' A' FourthDegree# EOL FourthCCWF {reset flag} END IF FifthCW? FORMAT(FifthDegree#,2) ' B' FifthDegree# EOL FifthCWF {reset flag} END IF FifthCCW? FORMAT(FifthDegree#,3) ' B' FifthDegree# EOL FifthCCWF {reset flag} END RETURN
DoFeed: Save# Num#('2') MUL# Recall# Num#('1') NumSc#('1') ' ' IF LTEqual? Recall# Num#('2') Num#('6') Num#('1') ELSE IF LTEqual? Recall# Num#('2') Num#('9') Num#('2') ELSE IF LTEqual? Recall# Num#('2') Num#('13') Num#('3') ELSE IF LTEqual? Recall# Num#('2') Num#('16') Num#('4') ELSE IF LTEqual? Recall# Num#('2') Num#('19') Num#('5') ELSE IF LTEqual? Recall# Num#('2') Num#('23') Num#('6') ELSE IF LTEqual? Recall# Num#('2') Num#('26') Num#('7') ELSE IF LTEqual? Recall# Num#('2') Num#('29') Num#('8') ELSE Num#('9') END END END END END END END END RETURN
SubWarning: IF NOT FeedConnect? IF AnyZshift? SetLineStrtChr('') ASCII('39') EOL ASCII('39') 'WARNING Z CLEARANCE WILL CHANGE WITH EACH CYCLE OF SUB REPEAT' EOL ASCII('39') EOL SetLineStrtChr('?') END END RETURN
StdSub: ' G36 V20 ' Repeats# EOL { Store value to variable 20 } SetLineStrtChr('') '>' Program# EOL SetLineStrtChr('?') ' G34 V20' EOL { Decrement the value of variable 20 by 1 } ' G37 ²' Program# EOL { SubCall } ' G35 V20 Å‚' Program# EOL { If value of variable does not equal 0, then loop back } StartSub RETURN
FinishSub1: {part 1} IF NOT FeedConnect? IF AutoCycle? ' ZV10' EOL { ZCP3C } ELSE IF FIFO? {.81} FeedC ' ZV10' CkFeedEntC EOL { ZCP3C } ELSE RapidC ' ZV10' EOL { ZCP3C } END END END RETURN
OpenMP: IF NOT WorkFixtureOffsets? NewProg ' G36 V20 ' Parts# EOL { Store value to variable 20 } SetLineStrtChr('') '>' Program# EOL SetLineStrtChr('?') ' G34 V20' EOL { Decrement the value of variable 20 by 1 } ' G37 ²' Program# EOL { SubCall } ' G35 V20 Å‚' Program# EOL { If value of variable does not equal 0, then loop back } StartSub END RETURN
CloseMP: IF NOT WorkFixtureOffsets? Preset ShiftPC EOL CloseSub Preset UnshftPC EOL END RETURN
ArcSegTest: SetStatusOff SetFlagF('1') IF GTEqual? ABS# ArcR# Num#('250') SetFlag('1') ELSE IF LessThan? ArcI# Num#('0') SetFlag('1') ELSE IF LessThan? ArcJ# Num#('0') SetFlag('1') ELSE IF GTEqual? ArcI# Num#('1200') SetFlag('1') ELSE IF GTEqual? ArcJ# Num#('1200') SetFlag('1') END END END END END SetStatusOn RETURN
FormatArc: IF ArcCW? CWArc ELSE CCWArc END IF ArcIJFormat? MoveXY ' ' ArcI# ' ' ArcJ# ELSE ' ' ArcR# MoveXY END RETURN
StdLine: {enables CRC on first call, .70} IF Decelerate? IF RoomToDecel? DecelMove1 Feed MoveXYC CkFeedRateC EOL DecelMove2 END Feed MoveXYC DoDecelFeed EOL ELSE IF XMove? OR YMove? OR ZMove? Feed MoveXYC CkFeedRateC EOL END END RETURN
ToolPath: ResetCRCNum {.72} EACHFeat IF PointFeat? IF AutoCycle? MoveSXYC EOL ' G37 ²' Program# EOL { SubCall } CalcACSRXY {calc tool position after sub call, CalcAutoCycleStatusRecordXY} ELSE MoveSXYC EOL {.80.01} END ELSE IF RapidFeat? IF AutoCycle? Rapid MoveXYC EOL ELSE IF XMove? OR YMove? OR ZMove? Rapid MoveXYC EOL END END ELSE IF LineFeat? IF AutoCycle? {.70} IF LastFeat? Feed MoveXYC CkFeedRateC EOL ELSE IF ZMove? {skip CRCOn until first non-Z move line, skipping ramps} Feed MoveXYC CkFeedRateC EOL ELSE StdLine {enables CRC on first call} END END ELSE StdLine END ELSE IF ArcFeat? ArcSegTest IF Flag?('1') { Need to Segment ArcFeat } SetFlagF('1') {ArcSegReport} ChordLength ELSE EACHQuadrant { Do not use NOT, FIRST, LAST or NEXT modifiers in this loop } IF LastQuadrant? AND Decelerate? IF RoomToDecel? DecelMove1 FormatArc CkArcFeedC EOL DecelMove2 END FormatArc DoDecelFeed EOL ELSE FormatArc CkArcFeedC EOL END NEXTQuadrant END END END END END NEXTFeat RETURN
WFOStuff: { Does not support WorkFixtureOffsets } RETURN
AutoCycCutSub2: {part 2} ToolPath AbsOrInc EOL IF Repeats? AND FeedConnect? AND ZshiftOnly? {.69 removed RapidC} {.71.2 removed CRCOffC, gets turned off in ToolPath} ELSE IF FIFO? {.81} FeedC ' ZV10' FeedEntC EOL { ZCP2C } ELSE RapidC ' ZV10' EOL { ZCP2C } END END CloseSub SetSRSubXY {restore SR to 1st position value} SetSRSubMove RETURN
AutoCycPat: SetPass2 {position pattern} ToolPath {call after NewProg for correct sub calls} SetPass1 {reset} RETURN
Milling: IF AutoCycle? NewProg AutoCycCutSub1 EntryMove AutoCycCutSub2 AutoCycPat ELSE EntryMove ToolPath END RETURN
{Start of executable Prog **************************************************}
{setup and initializations} InitProg SkipZ ReverseXZArcs InitWFONum SetFlood UseSeparateSubCalls SetMaxSeparateSubCalls('50') SetMaxRPM('10000') SetMaxFeed('500') SetFlagF('1') { ArcSegTest } IF PSComment? AND UseComments? 'PostScript:' EOL ' Literals: put between single or double quotes.' EOL ' Separate commands and literals with at least one space.' EOL ' A CR ( RETURN key ) will start a new line.' EOL ' Commands: may be capital and/or lower case letters. Separate commands with a space.' EOL ' EndOP -' EOL ' all literals and commands before an ENDOP command' EOL ' will appear at the beginning of the operation. All ' EOL ' literals and commands after an ENDOP command will appear' EOL ' at the end of the operation. ' EOL ' NewWFO(56), NWFO(56) -' EOL ' The Work Fixture Offset # you specify will be used for all following operations.' EOL ' Do not use with the ncPost multiple part option.' EOL ' 4thAxisCW(12.5), 4ACW(12.5) -' EOL ' generates a + A move of the value you specify' EOL ' 4thAxisCCW(22.5), 4ACCW(22.5) -' EOL ' generates a - A move of the value you specify' EOL ' 5thAxisCW(30), 5ACW(30) -' EOL ' generates a + B move of the value you specify' EOL ' 5thAxisCCW(22.5), 5ACCW(22.5) -' EOL ' generates a - B move of the value you specify' EOL END EachOp {Start of post processing *********************} IF FirstOperation? IF ToolChangeAtHome? SetHome END IF UseComments? IF ProgramNameComment? ' ' ASCII('39') 'PROGRAM: ' ProgramName$ END IF ProgramComment? ASCII('39') ProgramComment$ EOL END IF FormatNameComment? ASCII('39') 'FORMAT: ' FormatName$ EOL END IF TimeComment? ASCII('39') Date$ ' AT ' Time$ EOL END IF MovesComment? {ASCII('39') 'OUTPUT IN ' MoveType$ ' METERS' EOL} END IF PartsComment? ASCII('39') 'PARTS PROGRAMMED: ' Parts# EOL END IF StartToolComment? ASCII('39') 'FIRST TOOL NOT IN SPINDLE' EOL END END SetLineStrtChr('?') OpenSub RestoreScale IF MultipleParts? AND AllToolsOnePart? OpenMP END DoOpComments DoPostScript Plane { No Output } IF MultipleParts? AND OneToolAllParts? AND FullUp? OpenMP END CheckPass ' G28 Z' EOL { ZCP1 } AbsOrInc EOL CRCOnC EOL Rapid StrtPos EOL IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane? OpenMP StrtPos EOL END ELSE IF NewTool?
{Finish off last Operation}
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane? CloseMP END CRCOffC EOL ' G28 Z' EOL { OfstOff } IF MultipleParts? AND OneToolAllParts? AND FullUp? CloseMP END DoEndOpPS Rapid ' X0 Y0' EOL Rapid ' Z0' EOL ' G38 MOTOR OFF' EOL { ProgStop }
{Start new Operation}
SetLineStrtChr('') ' ' EOL DoOpComments DoPostScript Plane { No Output } SetLineStrtChr('?') IF MultipleParts? AND OneToolAllParts? AND FullUp? OpenMP END CheckPass ' G28 Z' EOL { ZCP1 } CRCOnC EOL Rapid StrtPos EOL IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane? OpenMP StrtPos EOL END ELSE IF SameTool? CRCOffC EOL DoEndOpPS
IF LAST ProgStop? ' G28 Z' EOL { OfstOff } Rapid ' X0 Y0' EOL Rapid ' Z0' EOL ' G38 MOTOR OFF' EOL { ProgStop } ELSE IF NewToolOffset? ' G28 Z' EOL { OfstOff } END END
{Start new Operation}
SetLineStrtChr('') ' ' EOL SetLineStrtChr('?') GetStartOfSameTool Plane { No Output } ' G28 Z' EOL { ZCP1 } CRCOnC EOL Rapid StrtPos EOL END END END {common point for all operations} IF Milling? IF Repeats? NewProg IF ZshiftOnly? IF AutoCycle? {incremental Autocycle sub can have Z moves} ZonlyRepAutoCycle ELSE {Z shift only, NOT Auto Cycle} IF UseSeparateSubCalls? AND CyclesLessThanMaxSubCalls? FindAnyZMoves {for normal abs subroutine} IF NoZMoves? ZonlyRep ELSE G92Sub {pattern shift, not element} END ELSE {no sep subs desired} G92Sub END END {end Auto Cycle IF} ELSE {not Z only} G92Sub END {end Z only IF} ELSE {no repeat OPs} Milling END ELSE IF Drilling? IF Repeats? NewProg StdSub AbsOrInc EOL Rapid StrtPos EOL END DrillCP EOL GetCycle Cycle FromCP StrtPos ZDepth RLevel Dwell Peck Retract FeedEnt EOL TrackZNO# FIRST SPZ# {.81.2} ToolPath IF RetractToCP1? {.81} TrackZNO# ClearancePlane1# ELSE TrackZNO# ClearancePlane2# END ' G80' EOL IF Repeats? FinishSubG92 END RapidC ZCP3C EOL END END NextOp {loops back to EachOP until last Operation}
{End of program ************************************************************}
{finish last operation} IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane? CloseMP END IF MultipleParts? AND OneToolAllParts? AND FullUp? CloseMP END CRCOffC EOL DoEndOpPS ' G28 Z' EOL { ZCP1 } Rapid ' X0 Y0' EOL Rapid ' Z0' EOL IF MultipleParts? AND AllToolsOnePart? CloseMP END ' G38 MOTOR OFF' EOL CloseSub Post2 {organize Subs into one program} Close SetLineStrtChr('') Retag {IF UseComments? SetScale('1') {restore scale for comments} Reopen IF FileBytesComment? ASCII('39') 'FILE LENGTH: ' FileBytes# ' CHARACTERS' EOL END IF FileFeetComment? ASCII('39') 'FILE LENGTH: ' FileFeet# ' FEET' EOL END IF FileMetersComment? ASCII('39') 'FILE LENGTH: ' FileMeters# ' METERS' EOL END Close END}