How do I do a manual tool change?

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.

More
22 Nov 2017 00:19 - 22 Nov 2017 00:20 #102164 by andypugh
If that is the "jog while in toolchange" patched version of hal_manualtoolchange then I suspect that not many people are using it.

There is a better way, if you can fit a tool-length sensor to the bed then you can have LinuxCNC automatically measure the tool for you after each change. This is actually easier, because it doesn't involve leaving Auto mode and then re-starting.

[Edit] Easier for LinuxCNC, that is. It is a bit more trouble to set up.
Last edit: 22 Nov 2017 00:20 by andypugh.

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

More
22 Nov 2017 08:36 #102177 by agris
andypugh, some people do. we do :)
It's really good and convenient to set new z-height for next tool, especially when you need to set tool up in different places of a part being machined. Also that's cool when you need to machine only one part (no series).

cptX, we also experience some troubles with modified code of manaultoolchange hal
Sometimes it works, sometimes doesn't - you may press "continue" but program just stops.
This, if fact, depends on Gremlin window. You may notice, that sometimes lines of code run down, sometimes G-code stucks on some line of code and doesn't move, but program runs!
To avoid "stucking" just click with mouse anywhere inside Gremlin's graphical area - and you\ll get your lines running again.
Then, when ToolChange window appears - you need to go back to LinuxCNC to jog or whatsoever.
Trick is - click on G-code window on the current line - it''ll become gray and "selected".
If "continue" button in ToolChange window fails - you're still on the line, where you should be.
Right-click, Start From Here - and you're done.

Hope this helps.

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

More
22 Nov 2017 11:00 #102180 by eslavko
On old version (running Ubuntu) that's works without problem. I use it near all the time. Probably way more people use that than Andy think. For users with simple machines with collet spindle the inserted tool has different length every time.

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

More
29 Nov 2017 19:15 #102502 by cptX
Yes, I absolutely agree! This is exactly what I have, too!
I rewrote the whole patch from the beginning. The previous patch, had too many unnecessary modifications, including many comments that he doesn't understand what is happeninng in the code. Plus the window Manual tool change was always visible. I now hide this window from the beginning.

The only fear I have is that linuxcncStat.read_line may not be reliable in all cases!

I will test it and I will give you a feedback.
The following user(s) said Thank You: whoppa

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

More
01 Aug 2018 19:57 #115339 by whoppa
Thank you, worked for me, just what I wanted.
i am new to Linux and had to get root access to be able to edit tool change file.

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

More
02 Aug 2018 11:39 #115397 by agris

Yes, I absolutely agree! This is exactly what I have, too!
I rewrote the whole patch from the beginning. The previous patch, had too many unnecessary modifications, including many comments that he doesn't understand what is happeninng in the code. Plus the window Manual tool change was always visible. I now hide this window from the beginning.

The only fear I have is that linuxcncStat.read_line may not be reliable in all cases!

I will test it and I will give you a feedback.


Hey cptX,

Any news on your reworked manual toolchange?
Please attach your file so I can try to test it, too.

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

Time to create page: 0.186 seconds
Powered by Kunena Forum