Hello Guest it is April 16, 2024, 02:20:34 PM

Author Topic: Re: Auto tool zero...manual tool change  (Read 2999 times)

0 Members and 1 Guest are viewing this topic.

Re: Auto tool zero...manual tool change
« on: April 02, 2019, 02:14:01 PM »
Like to know if someone can help me to make a script to do manual tool change I never programmed before..or show me a script I can use..
Re: Auto tool zero...manual tool change
« Reply #1 on: April 02, 2019, 02:21:01 PM »
Hi,
there are various examples of toolchanger scripts in:

Mach4Hobby/LuaExamples/Toolchanger

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Auto tool zero...manual tool change
« Reply #2 on: April 02, 2019, 04:50:36 PM »
Greg,

Check out the support video below for a versatile auto tool zero script that gives you the option to jog into place or enter in coordinates if you have a fixed touch plate.

https://youtu.be/6-4JkDv9AgM

-Bryanna
Newfangled Solutions Helpdesk: http://support.machsupport.com
YouTube Support Channel: https://www.youtube.com/c/MachSupportOfficial

Offline MN300

*
  •  298 298
    • View Profile
Re: Re: Auto tool zero...manual tool change
« Reply #3 on: April 02, 2019, 06:05:20 PM »
DazTheGas has also published a tool change script.
Video         https://www.youtube.com/watch?v=m1eMEec0N-E
Script text  http://www.machsupport.com/forum/index.php?topic=31032.0;wap2

A difference is that DazTheGas uses the tool length stored in mc.MTOOL_MILL_HEIGHT to pre-position the new tool to minimize probing time.
The Artsoft video stores the Z coordinate from probing in that variable. It's not referenced elsewhere in the script so it's not obvious why.

DazTheGas detects if a zero length is in the tool table with 'if toollen == 0'.
However this can fail because a tiny, but not quite zero, value floating point value is sometimes returned for a zero tool length.
Changing to 'if toollen < 0.01' fixes that problem.

The Tool Change LED flashes when M6 is called but the LED is not addressed in the script. I'm curious about what piece of code does that. Is it accessible and are there other hidden functions?
Re: Auto tool zero...manual tool change
« Reply #4 on: April 02, 2019, 06:42:19 PM »
Greg,

Check out the support video below for a versatile auto tool zero script that gives you the option to jog into place or enter in coordinates if you have a fixed touch plate.

https://youtu.be/6-4JkDv9AgM

-Bryanna

Very nice production ! I liked it. Well done.
I copied the macro below the video and pasted it in the cleared M6 .mcs and it was all on 1 line.
I figured out where to break/return but should I have had to do that ?
Can it be pasted as it needs to be in its final form ?
Thanks
Re: Re: Auto tool zero...manual tool change
« Reply #5 on: April 02, 2019, 07:36:35 PM »
Thanks everyone....
Re: Auto tool zero...manual tool change
« Reply #6 on: April 03, 2019, 08:07:41 AM »
I figured out where to break/return but should I have had to do that ?
Can it be pasted as it needs to be in its final form ?
Thanks

Overloaded,

I copied and pasted the script into a Notepad file (regular old Notepad) and it was a jumbled mess. I made no changes, opened up Mach4, went to Edit/Debug scripts, and pasted it into a copy of m6.mcs, and the formatting was exactly as it should be. I am use a development version (4134) but I have made no changes to any of the ZeroBrane settings. I'm not sure why you had to fix the formatting on your end. I'm working on collecting a few more sample scripts for Lua (and making videos on one or more of them) and getting the whole collection in a more accessible place. The FTP server is an option, but the copy/paste scenario is a potential nuisance there as well. Once I have something set up, I'll post about it here on the forum so everyone can start utilizing it.

-B
Newfangled Solutions Helpdesk: http://support.machsupport.com
YouTube Support Channel: https://www.youtube.com/c/MachSupportOfficial
Re: Re: Auto tool zero...manual tool change
« Reply #7 on: April 03, 2019, 09:12:29 AM »
Thanks -B, :)
First, pasted to word pad, then note pad, word wrap (jumbled mess), then to the editor ....and directly into the editor.. it ends up all on one line in the editor.
4.2.0.3804
I can work with it.
Thanks again,
Russ
Re: Re: Auto tool zero...manual tool change
« Reply #8 on: April 03, 2019, 08:14:33 PM »
-Bryanna I install your auto tool zero script and is working like it should
I find when it goes to probe it goes down to slow how can I make it go down just a little faster...thank you

Offline MN300

*
  •  298 298
    • View Profile
Re: Re: Auto tool zero...manual tool change
« Reply #9 on: April 03, 2019, 09:34:35 PM »
The DazTheGas script uses the tool length from the tool table to pre-position the tool for faster probing. You could borrow from that part of his code to speed things up. His method determines the difference between the next and current tool and adjusts the Z accordingly. The one from Bryanna assumes you started with the first tool zeroed to your touch plate and does the same with the next tools. It shouldn't be to hard to take the best of both.