#------------------------------------------------------------------------------- #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # Hacked by Dr. Wallace & Corey Johnson for haas mill # # # #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # # # File Name: 3mill.ppr # Software: IDEAS Generative Machining # SW Version: 6.0 # Author: JTM # Date Created: 1/7/98 # #------------------------------------------------------------------------------- # # Controller: generic # Machine: generic 3axis vertical mill # Config filename: none # Machine Geometry filename: none # #------------------------------------------------------------------------------- # # Revisions: none # # Expected PPVARS: none # Expected NC settings/commands: none # # User defined sections: # # firstmove: Stores the value of the first Z move # to the variable $z_home. This will be # used in GOHOME, TERMINATE_MIDFILE and # START_MIDFILE sections for a safe Z # height. # # toolchg: Outputs the tool change commands. # This user section is called from the # LINEAR, RAPID and CYCPNT sections. # # M and G codes used in the option file: # # M00 Program Stop # M01 Optional Stop # M02 End of Program (does not rewind program) # M03 Spindle On - Clockwise # M04 Spindle On - Counterclockwise # M05 Spindle Stop # M06 Tool Change # M07 Coolant On - Mist # M08 Coolant On - Flood # M09 Coolant Off # M30 End of Program (rewind memory) # # G00 Rapid Motion # G01 Linear Cutting Motion # G02 Circular Cutting Motion - Clockwise Arc # G03 Circular Cutting Motion - Counterclockwise Arc # G04 Dwell Command # G17 XY Plane Selection # G18 XZ Plane Selection # G19 YZ Plane Selection # G28 Reference Point Return # G40 Cutter Radius Compensation Cancel # G41 Cutter Radius Compensation - Left # G42 Cutter Radius Compensation - Right # G43 Tool Length Compensation Command # G48 Tool Radius Compensation Command # G49 Tool Length Compensation Cancel # G53 Work Offset Cancel G54 G55 # G54,G55 Work Offsets # G56 Work Offset Cancel G57 G58 G59 # G57..G59Work Offsets G57 G58 G59 # G70 Units = inch # G71 Units = mm # G73 Peck Drill Cycle # G80 Cancel Cycle # G81 Drill Cycle # G82 Facing Cycle # G83 Deep Hole Cycle # G84 Tap Cycle # G85 Bore and Ream Cycles # G90 Absolute Positioning Mode # G91 Incremental Positioning Mode # G94 Inches per Minute Feed Rate Mode # G95 Inches per Revolution Feed Rate Mode # G99 Return to R Plane for Canned Cycles #------------------------------------------------------------------------------- # Initialization Section #------------------------------------------------------------------------------- INIT: #----- Initialize commands workunits INCH scale=1.0 # units post works in outunits INCH scale=1.0 # units to be output seqno type=line step=10 # controls sequence numbers center start_center # controls arc center values arclim maxang=360.0 maxrad=999.9999 \ # limits on arc values minarc=0.005 chord=0.005 xyz absolute # type of output values #----- Constants constant _minmax min=-9999.9999 \ # limits on motion variables max= 9999.9999 #----- Real Variables format real 4.4 # default format for reals zerostring "0" # default format for "zero" real $X outstring="X" _minmax # motion variables real $Y outstring="Y" _minmax real $Z outstring="Z" _minmax real $I outstring="I" _minmax real $J outstring="J" _minmax real $K outstring="K" _minmax real $R outstring="R" _minmax real $XX outstring="X" _minmax real $z_home outstring="Z" _minmax real $F format=4.4 default=5.0 \ # feedrate outstring=" F" real $S format=5 default=1000 \ # spindle speed (5.1)!!! outstring="S" real $CYCDEPTH format=2.4 # cycle variables real $CYCFEED format=4.4 \ outstring=" F" real $CYCINCR format=3.4 \ outstring="Q" real $CYCDWELLVAL format=2.4 \ outstring="P" real $cycrplane format=4.4 \ outstring="R" real $cycdepth format=4.4 \ outstring="Z" real $cycincr format=3.4 \ outstring="Q" #----- Integer Variables format integer 4 # default format for integers integer $N format=5 default=10 \ # sequence number outstring="N" min=1 max=99999 integer $prog format=04 default=1999 \ # program number outstring="" integer $T format=04 default=01 \ # tool number outstring="T" integer $TSTA format=02 default=01 \ # tool station number outstring="T" integer $toolno format=02 default=01 \ # tool number outstring="T" integer $toolv format=02 default=01 \ # tool number value outstring="" integer $h format=02 default=01 \ # tool length offset outstring="H" integer $toolchg default=_NO # tool change flag integer $firstmove default=_YES # first move of program integer $firsttool default=_YES # first tool of program integer $cycleoffflag default = _NO # flag for cycle OFF #----- Token Variables token $d # cutter comp. value token $INSERT token $gcode default="G00 " # active gcode token $cyclecode default="G80 " # gcode for active cycle token $arccode default="G17 " # arc plane code token $coolcode default="M09 " # coolant code token $compcode default="G40 " # cutter comp. code token $spincode default="M05 " # spindle direction code token $cycleline # ascii CL data line token $numspace default=" " # space(s) after line number token $space default=" " # single space token $lineend default=";" # line ending #------------------------------------------------------------------------------- # User Defined Sections #------------------------------------------------------------------------------- firstmove: if $firstmove == _YES if ($CYCMODE == _OFF) $z_home = $Z else $z_home = $cycrplane endif $firstmove = _NO endif #------------------------------------------------------------------------------- toolchg: if ($toolchg == _YES) $toolchg = _NO $toolv = $toolno output $toolno $toolv $lineend $gcode = "G00 " if ($CYCMODE == _ON) $Z = $cycrplane endif output G54 $lineend #!!!!!!!!!!!!!!!!! output $gcode $Z $lineend output $S $spincode $lineend output $coolcode $lineend varclrout $F $lineend endif #------------------------------------------------------------------------------- # System Sections #------------------------------------------------------------------------------- COMMON: #--- Turns off cycles if next operation is not a cycle if ($cycleoffflag == _YES) && ($cycleline != $CLLINE) $cycleoffflag = _NO $gcode = "G80 " output $gcode $lineend varclrout $cycrplane varclrout $cycdepth varclrout $cycincr varclrout $CYCFEED varclrout $Z else $cycleoffflag =_NO endif #------------------------------------------------------------------------------- START: print " " print "*** Warning - this post uses the HOME position! ***" print " " prompt "Enter program number:" $prog $prog #$gcode = "G94 G70 G40 G53 G56 G99" output "%" output "O" $prog $lineend #output $gcode #$gcode = "T0000 G00 Z5.8571" #output $gcode #$gcode = "X11.3951 Y4.0637" #output $gcode $XX = 2*($X) START_MIDFILE: output G00 $z_home $lineend output $XX $lineend output G01 $Z $F $lineend #------------------------------------------------------------------------------- LOADTL: # tool numbers could be either the POST TOOL ID ($T) or the TOOL STATION # ($TSTA); commonly the tool length offset is the same as the tool number; # use $TOFFREG to get the length offset from the IDEAS menu $toolchg = _YES if ($firsttool == _YES) $firsttool = _NO else output [$coolcode] $lineend $spincode = "M05" output [$spincode] $lineend endif if ($T != 0) $toolno = $T else $toolno = $TSTA endif $h = $toolno LOADTL_REPEAT: # Section not called by IDEAS (in MS5) $toolchg = _NO print "Warning - Repeated tool number: " $T #------------------------------------------------------------------------------- SPINDL_OFF: $spincode = "M05" output $spincode $lineend SPINDL: # IDEAS does not use a spindle "ON" record if ($CLW == 1) $spincode = "M03" else $spincode = "M04" endif if ($toolchg == _NO) && ($NEWSPEED == _YES) output $S $spincode $lineend endif #------------------------------------------------------------------------------- COOLNT: if ($COOLNT == _OFF) $coolcode = "M09" else $coolcode = "M08" endif if ($toolchg == _NO) output [$coolcode] $lineend endif #------------------------------------------------------------------------------- FROM: firstmove # $gcode = "G00 " # output [$gcode] [$compcode] [$X] [$Z] $lineend #------------------------------------------------------------------------------- RAPID: toolchg # firstmove $gcode = "G00 " $XX = 2*($X) output [$gcode] [$compcode] [$XX] [$Z] $lineend #------------------------------------------------------------------------------- LINEAR: toolchg # firstmove $gcode = "G01 " $XX = 2*($X) output [$gcode] [$compcode] [$XX] [$Z] [$F] $lineend #------------------------------------------------------------------------------- ARCXY: $arccode = "G17 " if $CLOCKWISE == _YES $gcode = "G02 " else $gcode = "G03 " endif output [$arccode] [$gcode] $X $Y $I $K [$F] $lineend #------------------------------------------------------------------------------- ARCZX: $arccode = "G18 " $XX = 2*($X) if $CLOCKWISE == _YES $gcode = "G02 " else $gcode = "G03 " endif output [$arccode] [$gcode] $XX $Z $R [$F] $lineend #------------------------------------------------------------------------------- ARCYZ: $arccode = "G19 " if $CLOCKWISE == _YES $gcode = "G02 " else $gcode = "G03 " endif output [$arccode] [$gcode] $Y $Z $J $K [$F] $lineend #------------------------------------------------------------------------------- ARC3D: approx #------------------------------------------------------------------------------- # commonly the default radius offset is the same as the tool number; use # $CCOREG to get the radius offset from the IDEAS menu CUTCOM_ON: $d = cnvstr($toolno) $compcode = "G48D" + $d CUTCOM_LEFT: $d = cnvstr($toolno) $compcode = "G41D" + $d CUTCOM_RIGHT: $d = cnvstr($toolno) $compcode = "G42D" + $d CUTCOM_OFF: $compcode = "G40 " #------------------------------------------------------------------------------- CYCONOFF: # CYCLE/ON record not used by IDEAS # moved logic to COMMON section for cleaner output if $CYCMODE == _OFF $cycleoffflag = _YES endif #------------------------------------------------------------------------------- CYCDRILL: $cycleline = $CLLINE $CYCMODE = _ON $cyclecode = "G81 " CYCFACE: # Section not used by IDEAS (in MS5) print "WARNING - Cycle type not defined!" # $cycleline = $CLLINE # $CYCMODE = _ON # $cyclecode = "G82 " CYCTAP: $cycleline = $CLLINE $CYCMODE = _ON $cyclecode = "G84 " CYCBORE: $cycleline = $CLLINE $CYCMODE = _ON $cyclecode = "G85 " CYCREAM: $cycleline = $CLLINE $CYCMODE = _ON $cyclecode = "G85 " CYCSINK: # Section not used by IDEAS (in MS5) print "WARNING - Cycle type not defined!" # $cycleline = $CLLINE # $CYCMODE = _ON # $cyclecode = "G81 " CYCMILL: # Section not used by IDEAS. print "WARNING - Cycle type not defined!" CYCDEEP: $cycleline = $CLLINE $CYCMODE = _ON $cyclecode = "G83 " CYCBRKCHP: $cycleline = $CLLINE $CYCMODE = _ON $cyclecode = "G73 " CYCTHRU: # Section not used by IDEAS print "WARNING - Cycle type not defined!" #------------------------------------------------------------------------------- CYCPNT: # Section only used by IDEAS if $CYCMODE is set to "_ON" in the cycle sections; # otherwise LINEAR section will be called after reading a GOTO statement $cycdepth = $Z - $CYCDEPTH # ABSOLUTE Z depth of hole $cycrplane = $Z + $CYCPRE # ABSOLUTE Z of R plane toolchg # firstmove $gcode = $cyclecode $XX = 2*($X) if ($gcode == "G73 ") || ($gcode == "G83 ") if ($CYCMULT > 1) # constant peck increment $cycincr = ($CYCDEPTH-$CYCINCR)/($CYCMULT-1) else $cycincr = $CYCINCR endif output [$gcode] [$XX] [$cycrplane] [$cycdepth] [$cycincr] \ $lineend [$CYCFEED] else output [$gcode] [$XX] [$cycrplane] [$cycdepth] [$CYCFEED] $lineend endif #------------------------------------------------------------------------------- INSERT: output $INSERT $lineend OPSTOP: output M00 $lineend PPRINT: output \040 $PPRINT \041 $lineend #------------------------------------------------------------------------------- # The three sections GOHOME, END, and TERMINATE are all called by IDEAS; # the information in them could be combined into one section. GOHOME: output G00 $z_home $lineend END: if ($spincode != "M05") output M05 $lineend endif TERMINATE: output M30 $lineend output "%" TERMINATE_MIDFILE: output G00 $z_home $lineend output M00 $lineend #------------------------------------------------------------------------------- # End of post option file. # See Manual for additional sections. #-------------------------------------------------------------------------------