Tool change script for PlanetCNC TNG software

CNC USB Controller Software

Tool change script for PlanetCNC TNG software

Postby kreker » 13 May 2017, 08:36

Hello.

Does anybody have such script?

There is no tool change option at this moment.
kreker
 
Posts: 14
Joined: 27 Oct 2014, 10:13
Controller: Mk3

Re: Tool change script for PlanetCNC TNG software

Postby Support » 17 May 2017, 09:45

1. Open PlanetCNC TNG software installation folder. Locate scripts folder and open it.

2. Create new text file and name it: Machine.UserDefined_M6.gcode

3. Open script file with text editor.

Include this in file:

(print,This is M6)
(print,Selected tool: #<_selected_tool>)
(print,Current tool before: #<_current_tool>)
#1 = #<_x> (store current x position)
#2 = #<_y> (store current y position)
#3 = #<_z> (store current z position)
#100 = #<_feed>
#101 = #<_absolute>
G49
M5
G90
G53 G0 Z#<_motorlimit_zp> (move to safe height)
G53 G0 X#<_sensor_x> Y#<_sensor_y> (move to tool sensor position)
(msg,Please insert tool #<_selected_tool>)
M0

M6
(print,Current tool after: #<_current_tool>)
(msg, )

F#<_speed_probe> (set probe speed)
G38.2 Z-100000 (touch down)
G43.1 Z[#<_probe_z> - #<_sensor_z>] (set tool offset)
G53 G0 Z#<_motorlimit_zp> (move to safe height)
G0 X#1 Y#2 (move to last xy position)
o<100> if[[TOABSZ[#3] LT #<_motorlimit_zp>] AND [TOABSZ[#3] GT #<_motorlimit_zm>]]
G0 Z#3 (move to last z position)
o<100> endif

F#100
o<100> if[#101 GT 0.5]
(print,Restoring G90 mode)
G90
o<100> else
(print,Restoring G91 mode)
G91
o<100> endif

Use trial and error to see what would fit you. We do intend to do a more in depth tutorial for tool change.
Support
 
Posts: 2655
Joined: 07 Apr 2014, 17:39
Controller: Many controllers


Return to Software



Who is online

Users browsing this forum: Bing [Bot] and 3 guests

cron