Hello Guest it is March 29, 2024, 11:44:29 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - rajdzos

Pages: 1
1
Mach4 Videos / Re: Creating an M6 Toolchange in Mach4 (Part 3)
« on: October 07, 2018, 03:03:01 PM »
Just adding a thankyou! :)

I Made some Modifications
- Probemove for approach probe to avoid Crash :) 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: [Select]
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?

2
Mach4 General Discussion / Re: Mach 4+ Darwin LPT- motor doesn´t work
« on: October 04, 2018, 07:01:17 AM »
my mistake. i forget pin 17 enable motor

3
Mach4 General Discussion / Re: Mach 4+ Darwin LPT- motor doesn´t work
« on: October 01, 2018, 10:57:22 AM »
 win 7 32


i didn´t changing this setting. i try  Active low. tomorrow i try.

4
Mach4 General Discussion / Mach 4+ Darwin LPT- motor doesn´t work
« on: September 30, 2018, 08:08:47 AM »
Hi CNC maniacs.  Two days ago i transfer CNC to mach 4 because i hate linux (working good but win is win :-). Install mach 4, install Darwin and pay darwin. If i setting darwin i look to learning video. But motors doesn´t work.  Input Output Home XYZ emergency Stop etc function but motors ,,dead,. If i turn off PC motor function ( i dont turn with finger) if i turn ON PC motor dead and if i have enable in mach 4 motor doesnt start. Have you same problem?  Input and output pins i must setting on darwin and in mach 4 control. But motor pins i can setting only in Darwin. I do everything what i see in Tutorial video but mission failed.
 Sorry for my english i am czech.
CNC components ( LPT controll desk http://www.cncshop.cz/cnc-io-board_c), driver 3ND883, leashine stepper 863S42
thanks for answer

in the near future I would like to buy ESS
 

Pages: 1