Hello Guest it is April 26, 2024, 09:31:08 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 - rae_gordon

Pages: 1 2 3 4 »
1
Sorry, but the PMDX is a 422 not 411

2
Another test, with attached log file.  the system stopped when it hit the touch plate, and the log shows the last entry

3
During further tests, I am stuck waiting for motor 2 signal.  inserted a message box after the probe and before the move code and it had no effect

4
I forgot to mention that when I originally updated, I corrupted my system and had the mustard screen and have since reinstalled everything per instructions.  everything seems to work now except that.

5
I upgraded firmware on my PMDX 411 and am now having issues in regards to M6 command.  When I debug it works fine, but when I run it as a command it gets stuck on "mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")"   The command executes, but instead of going to Z0.0, it gets close .047ish.  If i manually do am MDI  "G90 G53 G0 Z0.0" it goes to where it needs to no problem.  I did a debug and attached it.  I see it is waiting for a motor 2 to stop, which it doesn't get.  then an odd thing happens a few seconds later where I get a "Signal id 1123, (machine coord), changed from Low to High"

Just guessing here, but it seems that the probe function was tying up the command some how.  I put ">>>>" where it is hanging up.  I do get an occasional stop when the probe touches the plate and it just stays there instead of continuing.  may be related, but one thing at a time.

Any help would be appreciated.




  
Code: [Select]
function m6()
    local inst = mc.mcGetInstance();
    local selectedtool = mc.mcToolGetSelected(inst)
    local currenttool = mc.mcToolGetCurrent(inst)
    local hsig = mc.mcSignalGetHandle(inst, mc.ISIG_PROBE)
    local changetoo = mc.mcToolGetDesc(inst,selectedtool)
    local toollen = mc.mcToolGetData(inst, mc.MTOOL_MILL_HEIGHT, selectedtool)
   --your machine info custom to you
    local touchplate = -.195 -- this is the height above or below table surface for non flush touchplates.
    local longesttool = 6 -- this is the longest bit that you own that you could possibly use
    local zclearance = -11.375 -- this is the measurment from your collet to the fixed touchplate
    local probeclearance = .5 -- this is safe distance above touchplate where you want probe to start
   -- end of your machine info
    local undefinedtoolprobe = (zclearance + longesttool +touchplate + probeclearance )
    local undefinedprobetravel = (zclearance + longesttool + touchplate)
    local probestart = (zclearance + toollen + probeclearance +touchplate)

    if selectedtool == currenttool then
        mc.mcCntlSetLastError(inst, "ToolChange Activated But Not Required") 
    else
        mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0") --move z axis all the way up
        mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 X0.464 Y-98.25") -- Move XY to above fixed touchplate location change to match your machine
        mc.mcCntlGcodeExecuteWait(inst, "G49") -- Cancels any current offsets
        if toollen ~= 0 then   -- if toollen is defined in tool table do this
            wx.wxMessageBox("Please change to tool "..selectedtool.." which is a "..changetoo.."")
            mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G1 Z"..probestart.." f25\n G91 G31 Z-1.25 F6") -- change "F#" to vary probing speed
            ProbeState = mc.mcSignalGetState(hsig)
                if ProbeState == 0 then -- if probe is not sensed this prevents a false zero from being utilized.
                        mc.mcCntlSetLastError(inst, "ERROR: Touch Probe was not detected")
                        mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
                        wx.wxMessageBox("ERROR: Touch Probe was not detected reset tool")
                        mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G1 Z"..probestart.." f25\n G91 G31 Z-1.25 F6")-- change "F#" to vary probing speed
                        ProbeState = mc.mcSignalGetState(hsig)
                            if ProbeState == 0 then -- no probe detected end cycle
                                mc.mcCntlSetLastError(inst, "ERROR: Touch Probe was not detected")
                                mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
                                wx.wxMessageBox("ERROR: Touch Probe was not detected Cycle stopped")
                                mc.mcCntlCycleStop(inst)
                            else
                                local zoffset = mc.mcAxisGetPos (inst, 2) - touchplate
                                mc.mcToolSetData (inst, mc.MTOOL_MILL_HEIGHT, selectedtool, zoffset)
                                mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
                                mc.mcCntlSetLastError(inst, "ToolChange Finished")
                                mc.mcToolSetCurrent(inst, selectedtool)
                            end
                else
            local zoffset = mc.mcAxisGetPos (inst, 2) - touchplate
            mc.mcToolSetData (inst, mc.MTOOL_MILL_HEIGHT, selectedtool, zoffset)
  >>>   mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
            mc.mcCntlSetLastError(inst, "ToolChange Finished")
            mc.mcToolSetCurrent(inst, selectedtool)
                end
        else
                wx.wxMessageBox("Tool Length is not Defined in Tool Table.\nset tool length manually and cycle start")
                mc.mcCntlCycleStop(inst)
               
        end
    end
mc.mcCntlGcodeExecuteWait(inst, "G43") --Turns on Offsets
end

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

    

6
Mach4 General Discussion / Re: mcCntrlGcodeExecuteWait fail
« on: April 11, 2018, 09:27:13 AM »
I am having a problem with a GcodeExecuteWait in my M6 when I do a tool change.  It used to work, and I am going to start a thread,  Mine is with the new update, using a PMDX 411.  In any case, when my is halting due "Requesting a stopped report for Axis 2 motors.  The stop comes in for motors 0 and 1 but not 2.  I also not that my Z location which is not at zero which is where it is commanded to go, it stops short.  In any case you may want to see if your DRO is showing the correct location when it fails..

7
Mach4 General Discussion / Re: Altering M6 but am confused
« on: September 19, 2016, 12:11:13 PM »
Oh BTW there is a downside to the program. If you stop the m6 for whatever reason before it probes, it will get stuck in a loop looking for a good probe and you will need to exit out to Mach4 and cancel the application running in the backgound.  Worth it though.

8
Mach4 General Discussion / Re: Altering M6 but am confused
« on: September 18, 2016, 09:56:34 PM »
BTW it may be obvious to most, or not, but this tool change function is based upon you putting the bit back into the collet at approximately the same location every time. Either by the manufacturers line, or a line that you mark on you bit as Daz shows in his video, IE sharpie.  If you are not consistant, within "half" of the tollerance you define in the program you run the risk of pushing the bit into your touch plate as it rapids down before the probe.  I have it set at .25, if I insert the bit .2 "in" too far into the router it will probe fine.  if for some reason I put it in .2 "out" the next time, then now it is now .4 from the previous set bit length and will rapid too far.  if you do the opposite the probe may not touch.

This is another disclaimer

9
Mach4 General Discussion / Re: Altering M6 but am confused
« on: September 18, 2016, 09:41:47 PM »
This is my working Code.   I tried to make it simple and self explanatory for those trying to adapt it to there machines. There are some lines that can be moved to the bottom to reduce the number of lines of code, as Daz did in Part 3 of his videos, maybe Rev 2 or I will leave it to Daz, I started to simplify it, but it left my else statements empty and I didn't know if it was acceptable to have and "Else", followed with an "End".  Also, I recommend reading all the comments next to the various lines of code as they may affect you based on your machine.

FYI,  I ran into an issue loading this code and any M6 code for that matter.  If I copy it into my directory, load Lua and Compile it.  It does not take effect, even if I restard Mach.  I had to delete the previous compiled version, the M6.mcc file, recompile it, and then it would take.  I ran a known good program and it skipped right over M6 without even calling it, couldn't manually run it in MDI either.  Ruined about 2 hours worth of work.  In anycase, I highly recommend that once you load it you use the MDI and verify that it did load.

My disclaimer, use at your own risk and test thoroughly.  Works for my machine, there are 4 scenarios in this code you need to test for.  1) regular bit change 2) bit too short which will prompt you to re-adjust bit, 3) 0 length in tool table, will probe and set length in tool table and 4) no bit in machine, with 0 length - this should prevent the z from traveling too far in the negative and or prevent the collet from hitting the table.  Also it should not matter if Offset is On or Off.

Please comment with any changes or operational problems that you experience and I will try to make future revisions for other users.  Though you get what you pay for so no promises. ::)

Code: [Select]
--(Revision 1.0) "Touch probe is at a fixed location" "tool table length is altered during probes"  Measurements I used are in inches
-- Rev 1.0 this code is based on a CNC Router table where zero is in a fixed location.  Mine is flush with the machine top.
--      In this version the tool table is altered every time by changing the bit length to whatever the probe measurement is.  You can leave your tool table lengths
--          blank and it will probe from a safe height the first time and enter the length for you, otherwise the length needs to be close to the length from the collet
--          to the end of the bit.
--  (if you do a tool change to an undefined tool or a tool with no length, it will automatically adjust and probe from a safe height)

--  ****** you must define "Local touchplate, longesttool, zclearance, and probeclearance" below based on your machine**********
--  *** my fixture offsets for G54, 55 etc is the distance from the collet to the worksurface, same as the zclearance and stays constant**

--  ****Note, My touchplate is flush with my top, because if this I have not tested the math for a touchplate.
--            A Neg number may be needed where expecting a positive make sure you test for your setup)



function M6()
    local inst = mc.mcGetInstance();
    local selectedtool = mc.mcToolGetSelected(inst)
    local currenttool = mc.mcToolGetCurrent(inst)
    local hsig = mc.mcSignalGetHandle(inst, mc.ISIG_PROBE)
    local changetoo = mc.mcToolGetDesc(inst,selectedtool)
    local toollen = mc.mcToolGetData(inst, mc.MTOOL_MILL_HEIGHT, selectedtool)
   --your machine info custom to you
    local touchplate = 0 -- this is the height above or below table surface for non flush touchplates.
    local longesttool = 6 -- this is the longest bit that you own that you could possibly use
    local zclearance = -11.375 -- this is the measurment from your collet to the fixed touchplate
    local probeclearance = .25 -- this is safe distance above touchplate where you want probe to start
   -- end of your machine info
    local undefinedtoolprobe = (zclearance + longesttool +touchplate + probeclearance )
    local undefinedprobetravel = (zclearance + longesttool + touchplate)
    local probestart = (zclearance + toollen + probeclearance +touchplate)

    if selectedtool == currenttool then
        mc.mcCntlSetLastError(inst, "ToolChange Activated But Not Required")  
    else
        mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0") --move z axis all the way up
        mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 X0.464 Y-99.808") -- Move XY to above fixed touchplate location change to match your machine
        mc.mcCntlGcodeExecuteWait(inst, "G49") -- Cancels any current offsets
        if toollen ~= 0 then   -- if toollen is defined in tool table do this
            wx.wxMessageBox("Please change to tool "..selectedtool.." which is a "..changetoo.."")
            mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z"..probestart.."\n G91 G31 Z-.5 F5") -- change "F#" to vary probing speed
            ProbeState = mc.mcSignalGetState(hsig)
                if ProbeState == 0 then -- if probe is not sensed this prevents a false zero from being utilized.
                    repeat
                        mc.mcCntlSetLastError(inst, "ERROR: Touch Probe was not detected")
                        mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
                        wx.wxMessageBox("ERROR: Touch Probe was not detected reset tool")
                        mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z"..probestart.."\n G91 G31 Z-.5 F5")-- change "F#" to vary probing speed
                        ProbeState = mc.mcSignalGetState(hsig)
                    until(ProbeState == 1)
                    local zoffset = mc.mcAxisGetPos (inst, 2) - touchplate
                    mc.mcToolSetData (inst, mc.MTOOL_MILL_HEIGHT, selectedtool, zoffset)
                    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
                    mc.mcCntlSetLastError(inst, "ToolChange Finished")
                    mc.mcToolSetCurrent(inst, selectedtool)
                else
            local zoffset = mc.mcAxisGetPos (inst, 2) - touchplate
            mc.mcToolSetData (inst, mc.MTOOL_MILL_HEIGHT, selectedtool, zoffset)
            mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
            mc.mcCntlSetLastError(inst, "ToolChange Finished")
            mc.mcToolSetCurrent(inst, selectedtool)
                end
        else
            wx.wxMessageBox("Please change to tool "..selectedtool.." which is a "..changetoo.."")
            wx.wxMessageBox("Tool Length is not Defined in Tool Table, Continue to Probe for Length")
            mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z"..undefinedtoolprobe.."\n G91 G31 Z"..undefinedprobetravel.." F5")-- change "F#" to vary probing speed
            ProbeState = mc.mcSignalGetState(hsig)
                if ProbeState == 0 then -- if probe is not sensed this prevents a false zero from being utilized.
                    repeat
                        mc.mcCntlSetLastError(inst, "ERROR: Touch Probe was not detected")
                        mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
                        wx.wxMessageBox("ERROR: Touch Probe was not detected reset tool")
                        mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z"..undefinedtoolprobe.."\n G91 G31 Z"..undefinedprobetravel.." F5")-- change "F#" to vary probing speed
                        ProbeState = mc.mcSignalGetState(hsig)
                    until(ProbeState == 1)
                    local zoffset = mc.mcAxisGetPos(inst, 2) - touchplate
                    mc.mcToolSetData (inst, mc.MTOOL_MILL_HEIGHT, selectedtool, zoffset)
                    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
                    wx.wxMessageBox("Toolchange Finished, Ensure Tool Table Description matches Tool")
                else
                local zoffset = mc.mcAxisGetPos(inst, 2) - touchplate
                mc.mcToolSetData (inst, mc.MTOOL_MILL_HEIGHT, selectedtool, zoffset)
                mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
                wx.wxMessageBox("Toolchange Finished, Ensure Tool Table Description matches Tool")
                mc.mcToolSetCurrent(inst, selectedtool)                
                end
        end
    end
mc.mcCntlGcodeExecuteWait(inst, "G43") --Turns on Offsets
--wx.wxMessageBox("Toolchange completed successfully, press OK to Continue")  -- Enable this to insert a pause before resuming a running program
end

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

10
Mach4 General Discussion / Re: Mach 4 V2 Windows 10
« on: September 18, 2016, 10:40:35 AM »
FYI everything still working if not better having upgraded.

Pages: 1 2 3 4 »