Hello Guest it is April 24, 2024, 06:40:46 PM

Author Topic: Surfcam post for Mach 3  (Read 3271 times)

0 Members and 1 Guest are viewing this topic.

Surfcam post for Mach 3
« on: October 06, 2021, 12:18:20 PM »

Hello all.

I have been looking and modifiying a post to get everything to work from surfcam to mach 3.   for a while I had problems with I J K    and finally removed them from the modal list and now I'm not having problems on spline cuts .   

I know just enough to sort these out and do NOT guarantee results,   USE AT YOU OWN RISK.  just trying to help as I had a heck of a time searching.  That goes into your M post  dir.   

cheers,    It wouldn't let me attach this as a     *********.m3       open your mpost dir.      copy and paste one of your   .m3 post      rename it  to Mach3     open with notepad        delete what is in there and paste below text and save.



name Mach3.M3

  #Drive \_usr\*.NCC                  # Fixed output path for NC Code file
LocalOutput? N                        # Machining Datum support
IgnoreSURFCAMSetAxis? Y               # Always use Template Index to calc rotary angles

 [REGISTERS]   in order of output:-
! 00                                  # Suppress block number signal
O 4                                   # Program ID number
N >4                                  # NC block numbers
g 2 G                                 # 2nd non-modal prep code (Abs/Incr bypass)
G 2                                   # Prep code
e 2.1 G                               # Extended work offset G-Code
p 2 P                                 # Extended work offset
X ->3.>4 No-Opt                       # Linear axis 1
Y ->3.>4 No-Opt                       # Linear axis 2
Z ->3.>4 No-Opt                       # Linear axis 3
I ->3.>4 No-Opt                       # Arc center X
J ->3.>4 No-Opt                       # Arc center Y
K ->3.>4 No-Opt                       # Arc center Z
A ->3.>3 No-Opt                       # Rotary stage about X-Axis
B ->3.>3 No-Opt                       # Rotary stage about Y-Axis
P 40 Mult 1000                        # Cycle dwell in milliseconds
Q ->3.>4 No-Opt                       # Cycle peck char
R ->3.>4 No-Opt                       # Cycle rapid stop
F >3.1                                # Feed register
H 2                                   # LComp register
D 2                                   # DComp register
T 2                                   # Tool code register
S >50 Limit 20 6000                   # Spindle speed minRPM maxRPM
M 2                                   # Misc code
o 4 O Add 9000                        # SubProgram ID number
L 2                                   # Subroutine call repeat
r 8                                   # String replacement dummy field
a >3.>4 ""                            # Tool Diameter
b >3.>4 ""                            # Tool Corner Radius
i >80 ""                              # Integer display field w' no prefix
f ->5.>4 ""                           # Floating point display field w' no prefix

         --- REGISTER MODALITY ---


ModalLetters X Y Z  A F R        # List of letters that are modal   
ModalGs 0 1 2 3 17 18 19 73 74 76 80 81 82 83 84 85  # List of G codes that are modal   


 [COMMANDS]
         --- GENERAL FILE ATTRIBUTES ---
         
Sequence#s N 0 1 1                    # Block numbering {Char, freq, incr & start}         
First#? N                             # Y/N  Output block number on first line of NC Code
Last#? N                              # Y/N  Output block number on last line of NC code
Spaces? Y                             # Y/N  Output spaces between word addresses
Comment ( )                           # Beginning/Ending comment characters
UppercaseComments? Y                  # Y/N  Force comment text to be uppercase
SbackDoor SupressHeader               # Suppress SIM header info
  * 00                                # Special EOB char before (CR)
  EOB nn                              # ASCII EOB code (max of 20 2-digit codes)
  Each *0                             # Special EOB char on each line
  Leading0s? Y                        # Output leading zero when reg values is less than 1.0

         --- COORDINATE SYSTEM ---
HCode X                               # Horizontal axis register
VCode Y                               # Vertical axis register
Dcode Z                               # Depth axis register
RevSigns                              # List of registers to have signs reversed
Inc/Abs G 91 90                       # Inc & Abs register & values
Incremental? N                        # Y or N  [Incremental or absolute] coordinate output       
Inch/MM 70 71                         # Inch & Metric G codes
Tolerance .0001                       # Round off tolerance
Work G                                # Work offset char             
WorkDefault 54                        # Default Work offset number
         --- FEEDRATE CONTROL ---
FeedCode F                            # Feed rate char
FeedType G 95 94 93                   # Feed uPR, uPM, 1/time codes
         --- SPINDLE & COMP ---
Spindle 3 4 5                         # Cw, ccw & stop M-codes
Coolant 8 9 7 8 8 8 8                 # Flood, Off, Mist, Lo, Hi, Thru Lo, Thru Hi codes
DComp 41 42 40                        # Diameter Comp Left, Right & Off G-codes
LComp 43 49                           # Length Comp On & Off G-codes

 [LINEAR MOVES]
LineCode
G01 X[H] Y[V] Z[D] F[FRate]
End

RapidCode
Comments
G00 X[H] Y[V] Z[D]
End

 [ARC MOVES]
ArcPlane G 17 18 19                   # G17, G18, G17 arc plane selection
Helical? Y                            # Helical interpolation support
CtrIncremental? Y                     # Incremental vectors [Y] or absolute position [N] for I & J
ByQuadrants? Y                        # Break arcs at quadrants [Y] or output 360 [N]
MaxRad 999 .001                       # Maximum arc radius & chordal deviation tolerance
MinRad .001                           # Minimum arc radius
RoundToQuad? Y                        # Inhibits 'round arc center to quad' feature – Y=default.
Cw G02
Ccw G03
CtrCode I J K
  CwCode
  G02 X[H] Y[V] Z[D] I[IVal] J[JVal] K[Kval] F[FRate]
  End

  CcwCode
  G03 X[H] Y[V] Z[D] I[IVal] J[JVal] K[Kval] F[FRate]
  End

 [NC CODE SEQUENCES]
StartCode
"%"                                   # Begin transmission code
!0 O[Program#] "(" {OutputName} ")"   # Program ID#
"(MACHINE: " {TemplateName} {TemplateExt} ")"
"(RUNDATE: " {Date} " TIME: " {Time} ")"
G00 G17 G[UnitMode] G40 G80 G90 M05
Set [Val8] To
  •                      # Toolpath counter

End

1stToolChange
" "
T[Tool] M06 "(DIAM: " a[ToolDiam] " -- CRAD:" b[Corner] ")"
Comments
If [Rigid] > 0 Then
 G00 G90 G[Work] X[H] Y[V]
Else
 G00 G90 G[Work] X[H] Y[V] S[Speed] M[Direct]
Endif
G43 Z[D] H[Lcomp] M[Cool]
End

ToolChange
M[CoolantOff]
" "
T[Tool] M06 "(DIAM: " a[ToolDiam] " -- CRAD:" b[Corner] ")"
Comments
If [Rigid] > 0 Then
 G00 G90 G[Work] X[H] Y[V]                # S/M are output on cycle line
Else
 G00 G90 G[Work] X[H] Y[V] S[Speed] M[Direct]
Endif
G43 Z[D] H[Lcomp] M[Cool]
End

Infeed         # Engage cutter comp
G01 G[Side] X[H] Y[V] D[DComp] F[FRate]
End

Outfeed        # Disable cutter comp               
G01 G40 X[H] Y[V] F[Frate]
End

EndCode        # End of program               
" "
M[CoolantOff]                         # Coolant OFF
g91 G28 Z0. M05                       # Retract spindle, Spindle OFF
g91 G28 X0. Y0.
T[Tool1] M06                          # Output 1st encountered tool
G90 M30                               # AbsCoords, Rewind
"(EstCycleTime: " f[TotalCutTime] " Min " f[TotalCutDist] " TravelInches])"
"%"                                   # End Of Transmission code
End

Index X
g91 G28 Z0.
G90 G00 G[Work] X[H] Y[V] A[RotAngle]
G43 H[Lcomp] Z[D]
End

UnWind
g91 G28 Z0.
G90 G00 A0.
G43 Z[D] H[Lcomp] M[Cool]
X0 Y0 A[LastRotAng]
G01 Z[D]
End

BeginLeadin
End
BeginLeadout
End
BeginPlunge
End
BeginRetract
End
BeginRow
End
BeginSideStep
End
BeginZLevel
End
EndLeadin
End
EndLeadout
End
EndPlunge
End
EndRetract
End
EndRow
End
EndSideStep
End
EndZLevel
End


 [SPINDLE CYCLES]
ZRestart? N                           # Restate cycles for each param change
ReturnPlane 98 99                     # G98 G99 Return Plane selection

ChipBreak
G73 G[RetPlane] X[H] Y[V] Z[D] Q[Vbite] R[Vclear] F[Frate]
End Cancel

Drill                                 # Drilling cycle     
G81 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

CSink                                 # Drilling cycle     
G82 G[RetPlane] X[H] Y[V] Z[D] P[Dwell] R[Vclear] F[FRate]
End Cancel

Peck                                  # Peck drill cycle       
G83 G[RetPlane] X[H] Y[V] Z[D] Q[VBite] R[Vclear] F[FRate]
End Cancel

Tap
If [Rigid] > 0 Then
G95 S[Speed]
Endif
G84 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

LTap
If [Rigid] > 0 Then
G95 S[Speed]
Endif
G74 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

Ream
G85 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

Bore
G86 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

Back
G87 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

Custom1
G81 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

Custom2
G81 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

Custom3
G81 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

Cancel
G80
If [Rigid] > 0 Then
 G94
Endif
End


Re: Surfcam post for Mach 3
« Reply #1 on: August 28, 2023, 07:04:24 AM »
doesnt work
anthony ghanem
Re: Surfcam post for Mach 3
« Reply #2 on: August 28, 2023, 01:38:12 PM »

I had some Modal problems this is my current.  not sure if it is the same as posted before as I was tweeking values.  this fixed some of the modal problems with arcs and splines.

this is to attempt to help others.  use at your own risk.     Please don't just post "doesn't work" as that doesn't help others sort out what to do.  post the error you are getting in Mach 3

thanks




name Mach3.M3

  #Drive \_usr\*.NCC                  # Fixed output path for NC Code file
LocalOutput? N                        # Machining Datum support
IgnoreSURFCAMSetAxis? Y               # Always use Template Index to calc rotary angles

 [REGISTERS]   in order of output:-
! 00                                  # Suppress block number signal
O 4                                   # Program ID number
N >4                                  # NC block numbers
g 2 G                                 # 2nd non-modal prep code (Abs/Incr bypass)
G 2                                   # Prep code
e 2.1 G                               # Extended work offset G-Code
p 2 P                                 # Extended work offset
X ->3.>4 No-Opt                       # Linear axis 1
Y ->3.>4 No-Opt                       # Linear axis 2
Z ->3.>4 No-Opt                       # Linear axis 3
I ->3.>4 No-Opt                       # Arc center X
J ->3.>4 No-Opt                       # Arc center Y
K ->3.>4 No-Opt                       # Arc center Z
A ->3.>3 No-Opt                       # Rotary stage about X-Axis
B ->3.>3 No-Opt                       # Rotary stage about Y-Axis
P 40 Mult 1000                        # Cycle dwell in milliseconds
Q ->3.>4 No-Opt                       # Cycle peck char
R ->3.>4 No-Opt                       # Cycle rapid stop
F >3.1                                # Feed register
H 2                                   # LComp register
D 2                                   # DComp register
T 2                                   # Tool code register
S >50 Limit 20 6000                   # Spindle speed minRPM maxRPM
M 2                                   # Misc code
o 4 O Add 9000                        # SubProgram ID number
L 2                                   # Subroutine call repeat
r 8                                   # String replacement dummy field
a >3.>4 ""                            # Tool Diameter
b >3.>4 ""                            # Tool Corner Radius
i >80 ""                              # Integer display field w' no prefix
f ->5.>4 ""                           # Floating point display field w' no prefix

         --- REGISTER MODALITY ---


ModalLetters X Y Z  A F R        # List of letters that are modal   
ModalGs 0 1 2 3 17 18 19 73 74 76 80 81 82 83 84 85  # List of G codes that are modal   


 [COMMANDS]
         --- GENERAL FILE ATTRIBUTES ---
         
Sequence#s N 0 1 1                    # Block numbering {Char, freq, incr & start}         
First#? N                             # Y/N  Output block number on first line of NC Code
Last#? N                              # Y/N  Output block number on last line of NC code
Spaces? Y                             # Y/N  Output spaces between word addresses
Comment ( )                           # Beginning/Ending comment characters
UppercaseComments? Y                  # Y/N  Force comment text to be uppercase
SbackDoor SupressHeader               # Suppress SIM header info
  * 00                                # Special EOB char before (CR)
  EOB nn                              # ASCII EOB code (max of 20 2-digit codes)
  Each *0                             # Special EOB char on each line
  Leading0s? Y                        # Output leading zero when reg values is less than 1.0

         --- COORDINATE SYSTEM ---
HCode X                               # Horizontal axis register
VCode Y                               # Vertical axis register
Dcode Z                               # Depth axis register
RevSigns                              # List of registers to have signs reversed
Inc/Abs G 91 90                       # Inc & Abs register & values
Incremental? N                        # Y or N  [Incremental or absolute] coordinate output       
Inch/MM 70 71                         # Inch & Metric G codes
Tolerance .0001                       # Round off tolerance
Work G                                # Work offset char             
WorkDefault 54                        # Default Work offset number
         --- FEEDRATE CONTROL ---
FeedCode F                            # Feed rate char
FeedType G 95 94 93                   # Feed uPR, uPM, 1/time codes
         --- SPINDLE & COMP ---
Spindle 3 4 5                         # Cw, ccw & stop M-codes
Coolant 8 9 7 8 8 8 8                 # Flood, Off, Mist, Lo, Hi, Thru Lo, Thru Hi codes
DComp 41 42 40                        # Diameter Comp Left, Right & Off G-codes
LComp 43 49                           # Length Comp On & Off G-codes

 [LINEAR MOVES]
LineCode
G01 X[H] Y[V] Z[D] F[FRate]
End

RapidCode
Comments
G00 X[H] Y[V] Z[D]
End

 [ARC MOVES]
ArcPlane G 17 18 19                   # G17, G18, G17 arc plane selection
Helical? Y                            # Helical interpolation support
CtrIncremental? Y                     # Incremental vectors [Y] or absolute position [N] for I & J
ByQuadrants? Y                        # Break arcs at quadrants [Y] or output 360 [N]
MaxRad 999 .001                       # Maximum arc radius & chordal deviation tolerance
MinRad .001                           # Minimum arc radius
RoundToQuad? Y                        # Inhibits 'round arc center to quad' feature – Y=default.
Cw G02
Ccw G03
CtrCode I J K
  CwCode
  G02 X[H] Y[V] Z[D] I[IVal] J[JVal] K[Kval] F[FRate]
  End

  CcwCode
  G03 X[H] Y[V] Z[D] I[IVal] J[JVal] K[Kval] F[FRate]
  End

 [NC CODE SEQUENCES]
StartCode
"%"                                   # Begin transmission code
!0 O[Program#] "(" {OutputName} ")"   # Program ID#
"(MACHINE: " {TemplateName} {TemplateExt} ")"
"(RUNDATE: " {Date} " TIME: " {Time} ")"
G00 G17 G[UnitMode] G40 G80 G90 M05
Set [Val8] To
  •                      # Toolpath counter

End

1stToolChange
" "
T[Tool] M06 "(DIAM: " a[ToolDiam] " -- CRAD:" b[Corner] ")"
Comments
If [Rigid] > 0 Then
 G00 G90 G[Work] X[H] Y[V]
Else
 G00 G90 G[Work] X[H] Y[V] S[Speed] M[Direct]
Endif
G43 Z[D] H[Lcomp] M[Cool]
End

ToolChange
M[CoolantOff]
" "
T[Tool] M06 "(DIAM: " a[ToolDiam] " -- CRAD:" b[Corner] ")"
Comments
If [Rigid] > 0 Then
 G00 G90 G[Work] X[H] Y[V]                # S/M are output on cycle line
Else
 G00 G90 G[Work] X[H] Y[V] S[Speed] M[Direct]
Endif
G43 Z[D] H[Lcomp] M[Cool]
End

Infeed         # Engage cutter comp
G01 G[Side] X[H] Y[V] D[DComp] F[FRate]
End

Outfeed        # Disable cutter comp               
G01 G40 X[H] Y[V] F[Frate]
End

EndCode        # End of program               
" "
M[CoolantOff]                         # Coolant OFF
g91 G28 Z0. M05                       # Retract spindle, Spindle OFF
g91 G28 X0. Y0.
T[Tool1] M06                          # Output 1st encountered tool
G90 M30                               # AbsCoords, Rewind
"(EstCycleTime: " f[TotalCutTime] " Min " f[TotalCutDist] " TravelInches])"
"%"                                   # End Of Transmission code
End

Index X
g91 G28 Z0.
G90 G00 G[Work] X[H] Y[V] A[RotAngle]
G43 H[Lcomp] Z[D]
End

UnWind
g91 G28 Z0.
G90 G00 A0.
G43 Z[D] H[Lcomp] M[Cool]
X0 Y0 A[LastRotAng]
G01 Z[D]
End

BeginLeadin
End
BeginLeadout
End
BeginPlunge
End
BeginRetract
End
BeginRow
End
BeginSideStep
End
BeginZLevel
End
EndLeadin
End
EndLeadout
End
EndPlunge
End
EndRetract
End
EndRow
End
EndSideStep
End
EndZLevel
End


 [SPINDLE CYCLES]
ZRestart? N                           # Restate cycles for each param change
ReturnPlane 98 99                     # G98 G99 Return Plane selection

ChipBreak
G73 G[RetPlane] X[H] Y[V] Z[D] Q[Vbite] R[Vclear] F[Frate]
End Cancel

Drill                                 # Drilling cycle     
G81 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

CSink                                 # Drilling cycle     
G82 G[RetPlane] X[H] Y[V] Z[D] P[Dwell] R[Vclear] F[FRate]
End Cancel

Peck                                  # Peck drill cycle       
G83 G[RetPlane] X[H] Y[V] Z[D] Q[VBite] R[Vclear] F[FRate]
End Cancel

Tap
If [Rigid] > 0 Then
G95 S[Speed]
Endif
G84 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

LTap
If [Rigid] > 0 Then
G95 S[Speed]
Endif
G74 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

Ream
G85 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

Bore
G86 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

Back
G87 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

Custom1
G81 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

Custom2
G81 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

Custom3
G81 G[RetPlane] X[H] Y[V] Z[D] R[Vclear] F[FRate]
End Cancel

Cancel
G80
If [Rigid] > 0 Then
 G94
Endif
End