Hello Guest it is December 06, 2019, 06:56:36 PM

Author Topic: upgraded firmware now M6 fails most of the time  (Read 734 times)

0 Members and 1 Guest are viewing this topic.

upgraded firmware now M6 fails most of the time
« on: April 11, 2018, 10:24:50 AM »
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

    
Re: upgraded firmware now M6 fails most of the time
« Reply #1 on: April 11, 2018, 10:27:29 AM »
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.
Re: upgraded firmware now M6 fails most of the time
« Reply #2 on: April 11, 2018, 12:11:55 PM »
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
Re: upgraded firmware now M6 fails most of the time
« Reply #3 on: April 11, 2018, 12:23:05 PM »
Another test, with attached log file.  the system stopped when it hit the touch plate, and the log shows the last entry
Re: upgraded firmware now M6 fails most of the time
« Reply #4 on: April 17, 2018, 04:07:26 PM »
Sorry, but the PMDX is a 422 not 411