Hello Guest it is June 08, 2024, 04:21:48 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 - rhtuttle

491
Mach4 General Discussion / Re: UC100 Mach4 Lathe G83 fail
« on: February 27, 2017, 07:00:15 PM »
Hi Steve,

Yes, unfortunately, Sim doesn't seem to cut very well for me.   ;D. You know what they say,

“In theory, theory and practice are the same. In practice, they are not.”

Since I was able to use the code with Mach3 and uc100 one would think it would work the same way using the same hardware with Mach4 and the new uc100 plugin.  Testing it against real hardware in real time is the only reliable method.  If it works on a lathe with Mach4 and Pokeys or pmdx controllers then it would point to the uc100 as the culprit or Mach4 if it fails for them.  Or if someone else has a uc100 and Mach4 and can't reproduce my error then it would point to my hardware or installation. 

I think  ???

492
General Mach Discussion / Re: mach3 sound?
« on: February 27, 2017, 10:26:00 AM »

493
Mach4 General Discussion / UC100 Mach4 Lathe G83 fail
« on: February 26, 2017, 07:15:49 PM »
When executing a G83 in Mach4 it does not perform as it should.  I have uploaded a YouTube video showing the failure.  I had previously used this exact same code when I was running under Mach3 before they came out with the Mach4 plugin and it worked perfectly.  UCNC believes it is a Mach4 bug.  Can any of you duplicate the error with any other motion controller or Uc100?
 

https://www.youtube.com/watch?v=oQWuqf_LF60

TIA

RT

494
Mach4 General Discussion / Re: Lua Macro Parameters
« on: February 25, 2017, 04:44:23 PM »
Steve, thanks for taking time to look at this.

I understand your method and will implement that way of doing this.

But I would like to understand why the failure occurs doing the way I have it so I don't replicate spending 6 hours trying to find an error.

If I understand you, the mcExecuteScript is only to be used with modules? 

Could you point me to where I can study up on what and how to make and use modules?

TIA

RT

495
If you change the amount of movement per jog, say from .01 to .1 or from .1 to 1 does the speed change?

if so, as a Test, change your acceleration setting on one of the axis and see if that is limiting the pendant speed.

496
If I read your question correctly go to the Jog flyout (tab key)
Look and see what the slow jog rate % is set at.

HTH

RT

497
Mach4 General Discussion / Re: Lua Macro Parameters
« on: February 25, 2017, 01:37:09 PM »
Newest wrinkle

From the MDI or Gcode file:

m6691                          runs as expected
m6691 d.9200               passes variable d and runs as expected

From a button left up script

mc.mcScriptExecute(0,'m6691.mcs',false)  locks up Mach4 gui

if it runs from the MDI and gcode file why not from a button call event?

I tested another macro m6692.mcs which contained only a wx.wxMessageBox('Hello') in the function call and it ran from the button.

I am missing some basic concept

RT

498
Mach4 General Discussion / Re: Lua Macro Parameters
« on: February 24, 2017, 07:57:44 PM »
Fresh restart of Mach4
Went old school and started a new macro and copied, pasted and tested line by line and it works. 

Either multiple failures confused Mach4 or the editor inserted an invisible character that didn't get copied.

Just another learning experience

RT

499
Mach4 General Discussion / Lua Macro Parameters
« on: February 24, 2017, 12:10:04 PM »
The following code compiles and executes in the script editor.  After it executes the editor I get a message saying the editor has failed and is closed yet it is open.  hParam is always 'error' when run in the editor.  When I try to run in Mach4 mdi 'm6690 D.9' the last error line says 'Do MDI 1' and nothing happens.  What am I doing wrong and how do you track down/test this?

Code: [Select]
--Reel Seat Insert
--Turn from current Z down to 0 from current X down to parameter D or .850

function m6690(hParam)
  local xNow,zNow,maxVal
  local TS,TR,TT --timer values Mach3 niy
  local plungeFeed=6
  local roughDOC=0.015
  local roughFeed=15
  local roughSpeed=900
  local finishDOC=0.004
  local finishFeed=8
  local finishSpeed=1400
  local inst=mc.mcGetInstance()
  local endX=.850 --param1()
 
  local inst=mc.mcGetInstance()

  mc.mcCntlSetLastError(inst,'')

  if (hParam ~= nil) then
    local DFlag = mc.mcCntlGetLocalVarFlag(inst, hParam, mc.SV_D)
    if(DFlag == 1) then
      endX = mc.mcCntlGetLocalVar(inst, hParam, mc.SV_D)
    end
  end

  xNow = mc.mcAxisGetPos(inst,0)
  zNow = mc.mcAxisGetPos(inst,2)
  if xNow<=endX then
    wx.wxMessageBox("start X is less than end Diameter of "..tostring(endX))
    return
  end
  if zNow<=0 then
    wx.wxMessageBox("start Z is less than or = to 0")
    return
  end
  --ts=Timer
 
--rough cuts 
  mc.mcCntlGcodeExecuteWait(inst,"M3 S"..tostring(roughSpeed))
  while (mc.mcAxisGetPos(inst,0)>(endX+finishDOC*2)) do
    currPos=mc.mcAxisGetPos(inst,0)
    maxVal=math.max(endX+2*finishDOC,currPos)
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(plungeFeed).." X"..tostring(maxVal-roughDOC))
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      wx.wxMessageBox("Spindle Stopped")
      return
    end
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(roughFeed).." Z0")
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      wx.wxMessageBox("Spindle Stopped")
      return
    end
    currPos=mc.mcAxisGetPos(inst,0)
    maxVal=math.max(endX+2*finishDOC,currPos)
    if currPos==endX+2*finishDOC then
      break
    end
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(plungeFeed).." X"..tostring(math.max(endX+2*finishDOC,currPos-roughDOC)))
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      wx.wxMessageBox("Spindle Stopped")
      return
    end
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(roughFeed).." Z"..tostring(zNow))
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      wx.wxMessageBox("Spindle Stopped")
      return
    end 
    if currPos==endX+2*finishDOC then
      break
    end 
  end
  -- tr=Timer-ts
  --wx.wxMessageBox("Roughing Time: "..tostring(tr))

  --finish cuts
  mc.mcCntlGcodeExecuteWait(inst,"M3 S"..tostring(finishSpeed))

  while (mc.mcAxisGetPos(inst,0)>=(endX+finishDOC)) do
    currPos=mc.mcAxisGetPos(inst,0)
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(plungeFeed).." X"..tostring(currPos-finishDOC))
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      wx.wxMessageBox("Spindle Stopped")
      return
    end
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(finishFeed).." Z0")
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      wx.wxMessageBox("Spindle Stopped")
        return
    end
    currPos=mc.mcAxisGetPos(inst,0)
    if currPos==endX then
      break
    end 
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(plungeFeed).." X"..tostring(currPos-finishDOC))
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      wx.wxMessageBox("Spindle Stopped")
      return
    end
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(finishFeed).." Z"..tostring(zNow))
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      wx.wxMessageBox("Spindle Stopped")
      return
    end
    currPos=mc.mcAxisGetPos(inst,0)
    if currPos==endX then
      break
    end 
  end
  mc.mcCntlGcodeExecuteWait(inst,"M5\nM9")
--te=Timer-ts
--wx.wxMessageBox("Roughing Time: "..tostring(tr).." - Total Time: "..tostring(te))
end
 
if (mc.mcInEditor() == 1) then
    m6690()
end   

Thanks for any help,

RT

500
Mach4 General Discussion / Re: Simulate Probe Strike
« on: February 21, 2017, 10:50:23 AM »
Thanks Daz, I would have looked at that for 2 days before seeing that.