How do I do a manual tool change?

More
20 Jan 2014 23:47 #43030 by ArcEye
Hi

I just do it in G Code if I want the spindle stopped and re-started

...
M5
G28
M6T2
M3
G4 P10
...

There are so many different types of toolchanger, with a lot not wanting the spindle stopped (almost all lathes), coding it is probably easiest

regards

Please Log in or Create an account to join the conversation.

More
20 Jan 2014 23:54 #43031 by eslavko

...
M5
G28
M6T2
M3
G4 P10


Maybe this is good option as in most cases when tool is changed the spindle speed is changed too.

Please Log in or Create an account to join the conversation.

More
25 Oct 2016 22:18 #82065 by robksawyer
I know this is a pretty old post, but I'm having the same issues as you were Gold Boarder. Can you share your latest config files? I'm also curious to see how you setup the Auto, Manual and MDI HAL GUI. Thanks.

Please Log in or Create an account to join the conversation.

More
25 Oct 2016 22:29 #82067 by andypugh
(User names are above the avatar, "Gold Boarder" is just a sign that he has posted a few hundred messages.)

Can you describe exactly what problems you are having?

Please Log in or Create an account to join the conversation.

More
25 Oct 2016 22:36 - 25 Oct 2016 22:37 #82068 by robksawyer
Ha (noob), realized that shortly after posting. I'm trying to get to where @eslavko is at (see below). I'm having the issue where linuxcnc is not letting me control the machine during this process. Also, I'm wondering if I should be going back to G53 (my home position) before the tool change instead of currently just raising the Z axis. I'm not sure how to do this exactly. Should I just run N90 G53 with no other parameters? I've attached an example of my current code.

"When M6 is executed the popup window is shown. And I happily change tool and make Z touchoff."

Machine: Sherline 5400 Mill
%
(1)
(T1  D=0.1275 CR=0. - ZMIN=-0.02 - FLAT END MILL)
(T50  D=0.0591 CR=0. - ZMIN=-0.002 - FLAT END MILL)
N10 G90 G94 G17 G91.1
N15 G20
N20 G53 G0 Z1.5
(18 TRACE1 0.02 OFFSET)
N25 T1 M6
N30 G0 X-1.0625 Y0.5413 Z0.6
N35 Z0.2
N40 G1 Z-0.02 F10.
N45 X-1.375 Y0. F20.
N50 X-1.0625 Y-0.5413
N55 X-0.4375
N60 X-0.125 Y0.
N65 X-0.4375 Y0.5413
N70 X-1.0625
N75 Z0.2 F10.
N80 G0 Z0.6
N90 G53 Z1.5
(1.5MM TRACE 0.002 OFFSET)
N95 M1
N100 T50 M6
N105 G0 X0.5485 Y-0.5413 Z0.6
N110 Z0.2
N115 G1 Z-0.002 F3.937
N120 X1.1735 F5.906
N125 X1.486 Y0.
N130 X1.1735 Y0.5413
N135 X0.5485
N140 X0.236 Y0.
N145 X0.5485 Y-0.5413
N150 Z0.2 F3.937
N155 G0 Z0.6
N165 G53 Z1.5
N170 M30
%
Last edit: 25 Oct 2016 22:37 by robksawyer.

Please Log in or Create an account to join the conversation.

More
26 Oct 2016 14:03 #82085 by agris
Hi, robksawyer

It's been mentioned above - you need to change hal_manualtoolchange file (located at /usr/bin)
it's a Python script LinuxCNC calls when M6 command is issued.
My owm machine uses new hal_manualtoolchange (see attach) - it's a bit buggy with LinuxCNC 2.7 but works.

Your G53 question is pretty simple - you may add any code prior to toolchange in your postprocessor, or manually.
Just an example: raise Z, then move to machine coordinates X10 Y200. Do toolchange. Raise Z again to safe top.
... your actual milling code 
G0 G53 Z100
G0 G53 X10 Y200
M6 T5
G0 G53 Z100
... your actual milling code
Attachments:

Please Log in or Create an account to join the conversation.

More
26 Oct 2016 16:54 #82101 by robksawyer
Thanks! I haven't cracked open the file yet, but if you're able to elaborate on what you changed in the file to cancel out or allow manual mode, I'd appreciate it. Id really like to understand some of the content of these scripts. What manual would I refer to if I wanted to make my own script like this?

Please Log in or Create an account to join the conversation.

More
15 Mar 2017 20:39 #89685 by Andyf97
( an old thread yes, but I was wanting to do the same today )
( SO I boched up this bit of G-code )


( Position the head over each hole in turn and use tool change )
( commands to pause the g-code while we manually tap that hole. )

( Manually adjust Z to be higher than anything, then test it.)
( After testing, place Z close to your work )

( M05 Ensure the spindle is not running, or dissable it with a key, in Tormach PCNC exists a lockout Key )

M05

(Drill 1 position )
G00 X20.7897 Y15.1542
M6T1

(Drill 2 position )
G00 X20.8303 Y45.1541
M6T2

(Drill 3 position )
G00 X60.8065 Y42.6206
M6T3

(Drill 4 position )
G00 X60.7727 Y17.6206
M6T4

(Drill 5 position )
G00 X91.9000 Y20.8285
M6T5

(Drill 6 position )
G00 X91.9250 Y39.3285
M6T6

(Drill 7 position )
G00 X116.7250 Y39.2950
M6T7

(Drill 8 position )
G00 X116.6999 Y20.7950
M6T8

( Return to the beginning )
G00 X0.0000 Y0.0000

( End the program )
M30

Please Log in or Create an account to join the conversation.

More
21 Nov 2017 21:49 #102156 by cptX
Hi guys I need to manually re-home Z axis in every tool change, so I need this functionality in any case and asap!
I tested with LinuxCNC 2.11 the scripts presented here and the script from gist.github.com/robanonymous/b677a47aed504548440c8258f71724b1
but none of them works correctly.
What is happening is when the code meets Tx M6 (x is the number of the tool) the dialog box appears and the execution of the gcode is stopped. So far so good.
If you press continue in the dialog box the program is doing nothing, doesn't continue or anything.
I checked the code and should theoretically continue from the next line, but nothing is happening...
If I press the Play button again the code continues from the beginning...

Any clues?

Please Log in or Create an account to join the conversation.

More
21 Nov 2017 23:27 #102161 by cptX
UPDATE!!!!!

I dug into the code and actually found out that both linuxcnc.stat().motion_line and linuxcnc.stat().current_line give wrong results.
I solved the problem by changing the line 52 from curLine = linuxcncStat.motion_line to curLine = linuxcncStat.read_line

According to linuxcnc.org/docs/2.6/html/common/python-interface.html
read_line: (returns integer) - line the RS274NGC interpreter is currently reading.

For me at version 2.7.11 works!!!
The question is how it was working for others or for previous versions with the other commands given that they are now unreliable and if it is now guaranteed to work with read_line

Please Log in or Create an account to join the conversation.

Time to create page: 0.744 seconds
Powered by Kunena Forum