Hello Guest it is March 28, 2024, 10:09:43 PM

Author Topic: Daz' M6 w Pneumatic collet add.. needs ATC, by Watchmaker  (Read 1229 times)

0 Members and 1 Guest are viewing this topic.

Daz' M6 w Pneumatic collet add.. needs ATC, by Watchmaker
« on: June 27, 2018, 09:55:55 PM »
Would like to first give a big Thank You to Daz for taking the time to make his wonderful videos and knowledge sharing.

I've tweaked Daz' manual tool change - probe macro to work with my NSK pneumatic collet spindle and now building a 10 tool or so ATC. I would like to inject the added (and needed) macro pieces within this working macro as it would also make for a good base for many to have a start of their own for Mach 4. If anyone could help it would be so greatly appreciated.

My machine is custom built by myself strictly for making complicated timepiece parts that require < 1 micron of error. My ATC needs are on the small 3mm shank size max. and stay raw at the shank. ATC will be a half circle on its own mount due to my custom X fixture by MiteeBite being the entire 12" length of my table, and needing to flip, again within < 1 micron of repeatability. Motor for ATChanger is on "A" and the only movement needed is on it's 180 degree arc. Tool is released and grabbed via M7 open / M9 close (my misting is tied to spindle on/off).

Also, I know a lot of you have asked Daz if he could post his macro for tool touch off and manual tool change. I searched forever to no avail and ended up doing a manual rewrite from his vid. I'll post mine here for all to have, but it does have about 5 days of tweaks to get it working for my system and needs. Please re-reference his original here:
https://youtu.be/w1xzYPT27NY

My tweaks to Daz' Macro:
Spindle off/on
Air collet release
(please note collet grab is not part of the macro. It's on a button on my touch screen to be used after tool change message stops the macro for)
Also.. biggest problem on his code was that there was no G31 ! Now placed where it should be.

This macro now kicks.

System:
NSK 50,0000 rpm pneumatic collet release spindle
Pokeys 57cnc
X/Y/Z
A = NEMA 17 ATC half circle for 3mm shank direct inject to collet


Needs:
ATC macro placed after M7 call here:
wx.wxMessageBox ("Please change to tool number "..selectedtool.." "..changetoo.."and press ok to continue")

Greatly appreciative of all the help.

/////////////////////////////////////////////////////


 WORKING WITH SPINDLE SHUT OFF AND COLLET OPENING FOR MACH 4
 Probe_Spindle Off/On_Pneumatic Collet opening_Feed Rate per Macro

////////////////////////////////////////////////////
 function m6()

   local inst = mc.mcGetInstance();
   local selectedtool = mc.mcToolGetSelected(inst)
   local currenttool = mc.mcToolGetCurrent(inst)
   local xstart = mc.mcAxisGetPos(inst, 0)
   local ystart = mc.mcAxisGetPos(inst, 1)
   
   if selectedtool == currenttool then
   return
   mc.mcCntlSetLastError(inst, "Toolchange Activated But Not Required")
   else
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 M5 G01 G94 z-20 F500\n x3.4 y27")
    RunProbe (currenttool)
   local toolz = mc.mcAxisGetPos (inst, 2)
   mc.mcCntlGcodeExecuteWait (inst,"G90 G53 G0 z-20.0")
   mc.mcCntlGcodeExecuteWait (inst,"M7")
   local changetoo = mc.mcToolGetDesc (inst, selectedtool)
   wx.wxMessageBox ("Please change to tool number "..selectedtool.." "..changetoo.."and press ok to continue")
   mc.mcCntlGcodeExecuteWait (inst,"G90 G53 G0 x3.4 y27")
   RunProbe (selectedtool)
   mc.mcAxisSetPos (inst, 2, toolz)
   mc.mcCntlGcodeExecuteWait (inst,"G90 G53 G0 z-20.0")
   mc.mcCntlGcodeExecuteWait (inst,"G90 M3 G0 x"..xstart.." y"..ystart)
   mc.mcToolSetCurrent (inst, selectedtool)
   wx.wxMessageBox ("Toolchange finished")
   end
end
function RunProbe (tool)
   local inst = mc.mcGetInstance ()
   toollen = mc.mcToolGetData (inst, mc.MTOOL_MILL_HEIGHT, tool)
   if toollen == 0 then toollen = 20 end
   mc.mcCntlSetLastError (inst, "Changing to fallback length")
   local probestart = -59 + toollen
   mc.mcCntlGcodeExecuteWait (inst, "G90 G53 G0 z"..probestart)
   mc.mcCntlGcodeExecuteWait (inst,"G01 G91 G31 z-29.0 F100")
end

if (mc.mcInEditor() == 1) then
 m6()
end



////////////////////////////////////////////////////////////////////////////