Toolchanger Setup

To set up a toolchanger using Wincnc's built-in tool library

  • m1 goes on atc1 line of the wincnc.ini file.
  • Use the tool library to set up the tools.
  • Dont use the h value on the atc1 line.
  • Don't use the n value on the atc1 line. Instead, use positions=
  • All M37 commands or other macros that use the H register for tracking the currently loaded tool should use T instead. (i.e. M37 Z H{TP1} would now become M37 Z0 T{tp1} ).
[wincnc.ini]

[toolchanger settings]
atc1=m1 a2
positions=p5 h5 t5

Parameter Passing

Parameter Passing is a fancy way of saying that Wincnc will allow you to create a macro, assign an L or M code (or other code) to the value, then call that macro and pass in some informatioin that is variable.

For instance we can create a simple macro called TEST.MAC. It looks something like this…

[TEST.MAC]
L91 G00 X{T} [ Move X by the value specified in the T parameter ]

Now we can assign an M-code to the macro, like this:

[cnc.mac]
M777=TEST.MAC

O.K. Let's try it out. Open WinCNC, type L777 T1 at the command line, then press Enter. The machine should move exactly one inch in the positive direction from its current location.


Sample Toolchanger Configuration

This sample Toolchanger configration is for a CAMaster Cobra CNC router with a Colombo automatic toolchanging spindle.

The Tool Change Macro

[sample tc macro]
L21 [DISABLE SOFT LIMITS]

m5.1               [Spindle Off NO WAIT]

L111 T{t}
M99  [Exiting - That tool is already loaded.]
M5.1          [Spindle Off - No Wait]

L112 T0 [SKIP NEXT LINE IF NO TOOL IS LOADED]
M98 TU.MAC            [UNLOAD CURRENT TOOL]

g4x.5

[m17.1 c6 [if tool present - (check physical sensor)
[g4[tool present
[m17.1 c6
[m99      [aborting  

g53 z0            [Retract Spindle]
m61 [move dust foot out of the way]

m5 [ SPINDLE OFF ]

L21 [DISABLE SOFT LIMITS AGAIN]

G53 T{T}XY        [Go to the load position.]

m52               [Prepare to accept Tool]
m17 c2            [waiting for drawbar to actuate]

G53 T{T}Z         [ plunge to T parameter's z pos.

m53               [Clamp tool]
g4x.5
m17 c3            [wait for tool clamped] 

L110 t{t}         [Select New Tool #]

G53 T{T}XY-2.69      [ PULL OUT THE TOOL]

G53 Z0            [Raise Spindle]

G53 T{T}Y-4.69 

L20 [ENABLE SOFT LIMITS]
M60

The Tool Unload Macro

[sample tool unload macro]

M5.1         [SPINDLE STOP
L21              [SOFT LIMS OFF
G53 Z0        [RETRACT Z Axis
M61         [DUST BOOT EXTEND]

G53 T{tp1}XY-2.69 [ GO TO UNLOAD POSITION ]
G53 T{tp1}Z      [ PLUNGE TO ATC HEIGHT ] 
G53 T{tp1}XY     [ Move into tool station ]    

M52 [ RELEASE TOOL ]
M17 C2
G4 X.5
M17 C2

G53 Z0 [ RETRACT Z ] 

L110T0 [ Tell machine NO TOOL is Loaded in the Spindle]

L20 [ SOFT LIMITS ON ] 

M53 [ DE-ACTUATE DRAWBAR ]
M18 C2 [WAIT FOR DRAWBAR ACT OFF]
G4 X.5
M18 C2

Tool Measure Files

[ THIS COMMAND WILL MEASURE
[ THE CURRENT TOOL.
[ PRESS ENTER TO CONTINUE
G4

L21
G53 Z0
G53 T1XY-2.69
G53 X{tmx}
G53 X{tmx}y{tmy} 
L91 G0 Z{tmd}
L91 G1 Z-10 M28 F10 G31
M37 Z{tm1} t{tp1}
G53 Z0
L91 G1 Z0 F50
G00
L20

G37CAL File

[Jog Bit To Table Before Running This Program]
L21
l92
g92
m37 z0 t{tp1}
g53 z0
g53 x{tmx}y{tmy}
l91 g1 z-10 m28 g31 f10
m37.1z
g53 z0
l91 g1 z0 f50
L20
page_revision: 18, last_edited: 1203628063|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License