Hello Guest it is March 28, 2024, 08:21:36 AM

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

0 Members and 1 Guest are viewing this topic.

Re: Re: Auto tool zero...manual tool change
« Reply #10 on: April 03, 2019, 09:39:04 PM »
I'm new to this programming..little help how would i do that...

Offline MN300

*
  •  297 297
    • View Profile
Re: Re: Auto tool zero...manual tool change
« Reply #11 on: April 03, 2019, 09:45:32 PM »
There are 4 parts to the DazTheGas videos. He show hows each function works as he builds up the script. It's also a good education on how to do Lua script. If it's more than you want to do right now I'll look into what to borrow.
Re: Re: Auto tool zero...manual tool change
« Reply #12 on: April 03, 2019, 09:58:49 PM »
I will take a look at DTZ videos..hoping I can get it right...

Offline MN300

*
  •  297 297
    • View Profile
Re: Auto tool zero...manual tool change
« Reply #13 on: April 04, 2019, 05:48:45 AM »
I have been thinking about safety. The script supplied by Bryanna is slow but safe. The auto script lines move the Z axis up clear the tallest workpiece. In most cases there will then be a lot of clearance to be traveled while probing.

The DazTheGas script is faster because it estimates the extra clearance and travels it at high speed, but it could crash the tool into the touch pad if the tool table length entry is too short.

A compromise would be to start the probing by assuming the longest tool length and making a rapid move to put the tip of that tool some small safety margin away from the pad. Then do the slow probing move to the pad. Shorter tools still will have some extra distance to travel.
The distance to travel at high speed could be calculated by mounting the longest tool and setting Z to 0. The existing script sets Z to 0 before showing the message  'Now in Tool Change Position. Hit Cycle Start!'
Measure the distance to the touch pad and then subtract the desired safety margin.

Add the new line between existing lines as shown below.
        mc.mcCntlSetLastError(inst, "Probing in Progress!")
        mc.mcCntlGcodeExecuteWait(inst, " G91 Z-xx.x") -- xx.x = distance from the pad to the longest tool minus a safety margin
        mc.mcCntlGcodeExecuteWait(inst, " G91 G31 Z-5. F5.")--probe the new tool
Re: Re: Auto tool zero...manual tool change
« Reply #14 on: April 04, 2019, 07:28:54 AM »
Ok I'll try that..thanks
Re: Re: Auto tool zero...manual tool change
« Reply #15 on: April 04, 2019, 07:55:14 PM »
The G91 Z-××.x") --xx.x=
Is the x spouse to mean something...

Offline MN300

*
  •  297 297
    • View Profile
Re: Re: Auto tool zero...manual tool change
« Reply #16 on: April 04, 2019, 08:19:43 PM »
xx.x shows where you enter the distance you want to the tool to travel before the probe command.
If it's 80mm from the longest tool to the pad after you set Z to zero and you want a safety margin of 2.5mm you would replace the x.xx with 77.5

mc.mcCntlGcodeExecuteWait(inst, " G91 Z-77.5")
Re: Re: Auto tool zero...manual tool change
« Reply #17 on: April 04, 2019, 08:37:31 PM »
Oh ok thanks ..I'll try it again..

Offline Azalin

*
  •  181 181
    • View Profile
Re: Re: Auto tool zero...manual tool change
« Reply #18 on: April 06, 2022, 06:25:12 AM »
Hi,
there are various examples of toolchanger scripts in:

Mach4Hobby/LuaExamples/Toolchanger

Craig

Looks like this file/folder is removed from recent versions.