Hello Guest it is April 25, 2024, 04:01:15 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.


Topics - rae_gordon

Pages: 1
1
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

    

2
Mach4 General Discussion / Altering M6 but am confused
« on: September 12, 2016, 05:33:08 PM »
I am attempting to create my own M6 code based on the videos provided but have run into some issues.  First off the reason I am altering the existing code is I don't want to perform 2 probes since I always reference the vacuum table as Z 0.0.   Because if this I only want my machine to go to a predefined spot, prompt to change bits, and Zero to the touch plate which is currently embedded flush with the work surface.  My main confusion is the commands for mcaxisgetpos and mcaxissetpos and how they relate to what I am doing.  I feel I have a good handle on it most of it, but after 8 hours of reading forums I figured it was time to eat my pride and ask for help.

Here is what I have so far, any help or corrections would be appreciated.

function M6()
    local inst = mc.mcGetInstance();
    local selectedtool = mc.mcToolGetSelected(inst)
    local currenttool = mc.mcToolGetCurrent(inst)
    local TouchPlateThickness = 0.0;                     --What is the offset for the touch plate to the table top.  I dont have this figured in yet.

    if selectedtool == currenttool then
    return
    mc.mcCntlSetLastError(inst, "ToolChange Activated But Not Required")
    else
    mc.mcCntlGcodeExecute (inst,"M05") --make sure spindle is not running
    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
    local changetoo = mc.mcToolGetDesc(inst,selectedtool)
    wx.wxMessageBox("Please change to tool number "..selectedtool.." "..changetoo.." and press ok to continue")
    currenttool = selectedtool --not sure if this goes in this location or is required elsewhere????
    toollen = mc.mcToolGetData(inst, mc.MTOOL_MILL_HEIGHT)
    if toollen == 0 then
    return
    wx.wxMessageBox("No tool length currently defined")
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0 \n G91 G31 Z-6 F25")
    mc.mcAxisSetPos(inst, 2, 0.0) ???
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
    --wx.wxMessageBox("Please turn on spindle and click ok to continue") --can be removed if required
    mc.mcToolSetCurrent(inst, selectedtool)
    mc.mcCntlSetLastError(inst, "ToolChange Finished")
    end
    else
    local probestart = -6 + toollen
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z"..probestart.."\n G91 G31 Z-1 F25")
    mc.mcAxisSetPos(inst, 2, 0.0) ???
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
    mc.mcToolSetCurrent(inst, selectedtool)
    mc.mcCntlSetLastError(inst, "ToolChange Finished")
    end
end


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


3
Mach4 General Discussion / Mach4 how good is your PC
« on: September 08, 2015, 05:35:55 PM »
I tried asking how good of a machine I need, so lets go this route to try to figure out what works and what doesn't

What are you using, and are you have experiencing any delay or have you had to downgrade your refresh rate? ---------If you tried something and it wasn't up to par, let us know that also so we know what to avoid.
Lets go with the following
Brand - Dell- homemade ?
Processor -  Intel, AMD ?
Processor Speed?
Installed RAM?
32bit or 64bit?
Video Card?

Thanks

4
     I have a new used CNC Router that I am upgrading with a PMDX-422 Controller.  I am holding of ordering Mach4 until I have the computer to install it on.  Right now, I am torn on building a Dedicated PC vs a Laptop or Touchscreen Tablet to utilize with this machine.  I understand that with Parallel Port, that timing was critical, and therefore Dedicated PC's are recommended.  Since Mach4 is not using a Parallel Port and has been redesigned from the ground up, is there any known issues with utilizing a off the shelf new Laptop or Tablet.  Of course Power save functions would be disabled.

In addition, I have another machine that I would like to upgrade in the future that is located in a different location, and would like to move the computer from machine to machine as I need.  I don't envision ever running both machines at the same time and don't want to invest in setting up another computer for it.

Pages: 1