Hello Guest it is April 24, 2024, 02:24:58 PM

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 - Graham Waterworth

351
Mach4 General Discussion / Re: Connection Lost with CSMIO/IP-S
« on: May 25, 2021, 10:03:06 AM »
I ended up using win7 pro because I could not get a reliable machine on windows 10, I run on an old atom based machine now and no problems.

352
G-Code, CAD, and CAM discussions / Re: fanuc robodrill
« on: May 05, 2021, 06:53:59 PM »
Use the G49 command.

353
Mach4 General Discussion / Re: Again with the tool setter
« on: May 03, 2021, 08:30:01 PM »
Try this version of the code, read the comments first.
Code: [Select]
function M6()
    local inst = mc.mcGetInstance();
    local changeToTool = mc.mcToolGetSelected(inst)
    local changeFromTool = mc.mcToolGetCurrent(inst)
    local XPositionBeforeToolChange = mc.mcAxisGetPos(inst,0)
    local YPositionBeforeToolChange = mc.mcAxisGetPos(inst,1)
    local XToolProbePosition = "1" -- Change to position of probe in X
    local YToolProbePosition = "1" -- Change to position of probe in Y
    local XManualToolChangePosition = "2"
    local YManualToolChangePosition = "2"
    local ColletAtProbeZCoordinate = -105 -- Machine Z-coordinate when collet tip touches TouchPlate (Must be more than ProbeOperationDistance - DefaultToolLength
    local ExtraProbeDistance = 5 -- SafetyMargin
    local ProbeOperationDistance = -50 -- 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,ProbeOperationDistance)
    local ToolZCoordinate = mc.mcAxisGetPos(inst,2)
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0 \n G90 G53 G0 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,ProbeOperationDistance)
    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,fProbeOperationDistance)
    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
        mc.mcCntlSetLastError(finst, "Tool length not found - using Default Length")
    end
    local probestart = fColletAtProbeZCoordinate + fExtraProbeDistance + toollen
    local GCODE = "G91 G31 Z"..probestart.." F"..fProbePrepSpeed
    GCODE = ""..GCODE.." \n G91 G0 Z1 F"..fProbePrepSpeed.." \n G91 G31 Z"..fProbeOperationDistance.." F"..fProbeSpeed
    mc.mcCntlGcodeExecuteWait(finst,GCODE)
end

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

354
Mach4 General Discussion / Re: Again with the tool setter
« on: May 03, 2021, 05:35:04 PM »
Where did you get the code below from?

355
In most cases the Z axis datum is on the centre line of rotation when using a 4th axis.  Then everything is programmed from this so no matter what angle the table is at the datum stays the same.

If you measure the distance from the table to the centre of the A axis in Z direction you can make yourself a steel block and use it to set all your tools on.

If you have a tool setter then you tell it the material thickness is the distance from table to indexer C/L in Z.

 

 

356
Mach4 General Discussion / Re: Again with the tool setter
« on: May 03, 2021, 04:19:30 PM »
Some pictures of the machine may help.

Also are you working from the XYZ home position or are you moving the datum using G54 etc.

Do you know the distance from a fixed point on the spindle to the table top?

Do you know the distance from the same fixed point on the spindle to the tool setter trigger point?

Do you have a DRO on your screen to set the thickness of the material?

If you have this information its a simple calculation based on the trigger point of the G31



357
General Mach Discussion / Re: Drifting X,Y,Z values.
« on: April 29, 2021, 09:29:28 PM »
I have just run your code here and all is good if I take out the M2 at the end of the code if I keep it in something strange happens and the code jumps back a few lines and stops.

I also think you need to sort out the native units and recalibrate the axis figures.

358
If it is a 3 channel rotary encoder then I am not sure that board can do that, I think its single pulse input as there is no encoder A,B,Z channel input marked on the case.

359
General Mach Discussion / Re: Threading with mach3
« on: April 29, 2021, 05:06:14 PM »
As long as you get a clean pulse into the board and the board can do index threading you are good, optical switches are better.

360
Run the machine with the spindle turned OFF and see if you get the error.