Welcome, Guest. Please login or register.
Did you miss your activation email?
October 16, 2018, 05:51:37 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  Mach4 General Discussion
| | |-+  Mach4 Videos
| | | |-+  Creating an M6 Toolchange in Mach4 (Part 3)
Pages: « 1 2   Go Down
Print
Author Topic: Creating an M6 Toolchange in Mach4 (Part 3)  (Read 4077 times)
0 Members and 1 Guest are viewing this topic.
DazTheGas
Active Member

Offline Offline

Posts: 724


DazTheGas


View Profile
« Reply #10 on: January 12, 2018, 02:21:37 AM »

Mach4 has come on a long way since making these videos and lots of new commands added, there will be an updated video soon on the way i now do it but still ask away  Wink

DazTheGas
Logged

Theres always time for a choccy biccy
gene8522
Active Member

Offline Offline

Posts: 117



View Profile
« Reply #11 on: January 12, 2018, 09:20:28 AM »

Thanks for the reply. I have been running Mach3 for about 7 years W/ Screenset2010 on my diy CNC without many problems. Now for some unknown reason, while running a gcode file, about every two minutes I keep getting an error code (error 3336) pop-up that shuts the program down. ArtSoft technicians dosen't know what to do about it. So I'm trying to install Mach4 V2 to see if it will correct these problem. Screenset 2010 has an M6 manual tool change that I would like to use with Mach4, but Mach4 will not run the 2010 screensets. I was wondering if it would be possible to get your latest M6 code and help getting it into my Mach4? 
Thanks in advance for your help. If it wasn't for these forums I would never have my DIY CNC working as well as it does.
Gene 
P.S. I don't have Mach4 completely installed yet, trying to get all of the settings just right is a pain you know where Angry Huh Evil
Logged
Firechief
Active Member

Offline Offline

Posts: 29


View Profile
« Reply #12 on: January 12, 2018, 10:46:59 AM »

I will be looking forward to the new video. I have your tool change run at this time.
Thanks.
Logged

Stop Drop and Roll
lesspaul
Active Member

Offline Offline

Posts: 22


View Profile
« Reply #13 on: June 12, 2018, 05:30:01 PM »

Here's hoping this update is still in the works. Thanks!
Logged
DazTheGas
Active Member

Offline Offline

Posts: 724


DazTheGas


View Profile
« Reply #14 on: June 13, 2018, 04:24:00 PM »

Yep still in the pipeline, just have to get machine finished first ;-)

DazTheGas
Logged

Theres always time for a choccy biccy
KatzYaakov
Active Member

Offline Offline

Posts: 30


View Profile
« Reply #15 on: June 26, 2018, 11:02:15 AM »

https://www.youtube.com/watch?v=uxeQrFIWq8U

change tool with servo magazine with mach 4
Logged
lsgreen
Active Member

Offline Offline

Posts: 22


View Profile
« Reply #16 on: July 08, 2018, 02:14:51 PM »

Greetings to all,
Iíve installed the m6 script on my machine, (thanks for everyoneís hard work), each time it runs the message boxes remain hidden. Obviously sense they canít be accessed, itís not possible to complete the routine. The only thing left to do is close Mach4 down. After Mach has closed the message boxes then appear allowing them to be closed also. The other messages in Mach appear to work normally. If an m6 command is in g code the machine will retract the z, move to the tool change position etc. If the command is issued in the MDI, nothing happens but it is apparent that Mach is in a wait condition, waiting for input from the message box. Iím sure there is a simple answer for this, I just canít find it.
Thanks, Lou
Logged
rajdzos
Active Member

Offline Offline

Posts: 4


View Profile
« Reply #17 on: October 07, 2018, 02:03:01 PM »

Just adding a thankyou! Smiley

I Made some Modifications
- Probemove for approach probe to avoid Crash Smiley and back off probe before real probing.
- Lots of Variables to tune the script
---Preset for probelocation
---Preset for ToolChange position
---Preset for defaults and speeds


Code:
function M6()
    local inst = mc.mcGetInstance();
    local changeToTool = 3--mc.mcToolGetSelected(inst)
    local changeFromTool = 2--mc.mcToolGetCurrent(inst)
    local XPositionBeforeToolChange = mc.mcAxisGetPos(inst,0)
    local YPositionBeforeToolChange = mc.mcAxisGetPos(inst,1)
    local XToolProbePosition = "1"
    local YToolProbePosition = "1"
    local XManualToolChangePosition = "2"
    local YManualToolChangePosition = "2"
    local ColletAtProbeZCoordinate = -103 -- Machine Z-coordinate when collet tip touches TouchPlate (Must be more than ProbeOperationDistance - DefaultToolLength
    local ExtraProbeDistance = 5 -- SafetyMargin
    local ProbeOperationDistance = -30 -- Length of Probemove before giving up
    local ProbePrepSpeed = 100
    local ProbeSpeed = 25
    local DefaultToolLength = 70 -- Used if tool info is not found. (Should be a value slightly longer than the longest tool in the shop :D)
        -- QUICK REFERENCE
        -- G90 - Absolute (Go to coordinate)
        -- G91 - Incremental (Godistance along axis from current position)
        -- G53 - Machine Coordinate Move

    if changeToTool == changeFromTool then
    return
    mc.mcCntlSetLastError(inst, "ToolChange Activated But Not Required")
    else
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0\nM5" )
    RunProbe(inst,changeFromTool,XToolProbePosition,YToolProbePosition,DefaultToolLength,ColletAtProbeZCoordinate,ExtraProbeDistance,ProbePrepSpeed,ProbeSpeed)
    local ToolZCoordinate = mc.mcAxisGetPos(inst,2)
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0 \n X"..XManualToolChangePosition.." Y"..YManualToolChangePosition)
    local changeToToolDescription = mc.mcToolGetDesc(inst,changeToTool)
    wx.wxMessageBox("Please change to tool number "..changeToTool.." "..changeToToolDescription.." and press ok to continue")
    RunProbe(inst,changeToTool,XToolProbePosition,YToolProbePosition,DefaultToolLength,ColletAtProbeZCoordinate,ExtraProbeDistance,ProbePrepSpeed,ProbeSpeed)
    mc.mcAxisSetPos(inst, 2 , ToolZCoordinate)
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
    mc.mcCntlGcodeExecuteWait(inst,"G90 G0 X"..XPositionBeforeToolChange.." Y"..YPositionBeforeToolChange)
    mc.mcToolSetCurrent(inst, changeToTool)
    wx.wxMessageBox("If Toolchange was Sucessful - click ok to continue")
    mc.mcCntlSetLastError(inst, "ToolChange Finished")
    end
end

function RunProbe(finst,ftool,fXToolProbePosition,fYToolProbePosition,fDefaultToolLength,fColletAtProbeZCoordinate,fExtraProbeDistance,fProbePrepSpeed,fProbeSpeed)
    mc.mcCntlGcodeExecuteWait(finst, "G90 G53 G0 X"..fXToolProbePosition.." Y"..fYToolProbePosition)
    local toollen = mc.mcToolGetData(finst, mc.MTOOL_MILL_HEIGHT, ftool)
    if toollen == 0 then toollen = fDefaultToolLength end
    mc.mcCntlSetLastError(finst, "Tool length not found - using Default Length")
    local probestart = fColletAtProbeZCoordinate + fExtraProbeDistance + toollen
    local GCODE = "G90 G53 G31 G0 Z"..probestart.." F"..fProbePrepSpeed
    GCODE = ""..GCODE.." \n G91 G0 Z5 F"..fProbePrepSpeed.." \n G91 G31 Z-15 F"..fProbeSpeed
    mc.mcCntlGcodeExecuteWait(finst,GCODE)
end

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

how i define probeposition?
Logged
Pages: « 1 2   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!