Hello Guest it is April 26, 2024, 11:50:18 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.


Messages - rhtuttle

361
Mach4 General Discussion / Re: Mach 4 Feature Request
« on: January 18, 2018, 10:54:31 AM »
Wouldn't it be wonderful if the api had a mcCntrlGetScrProperty('BtnName','BtnProperty')

This would eliminate the need to create register values that have to be set from an action and in order for a macro to access the value, string...

MTCW

RT

362
Mach4 General Discussion / Re: Mach Motion Lathe Wizards Bug? Help.
« on: January 18, 2018, 10:35:54 AM »
Yes, it is a bug.  You need to select one of the infeed options each time you use the threading wizard.  Even though it appears that to have defaulted to 'Flank Infeed, Constant Volume' it really hasn't and wont until you select it from the drop down list.

HTH

RT

363
Mach4 General Discussion / Re: Is Mach4 really Hobby Material?
« on: January 17, 2018, 10:56:56 AM »
The switch from Mach3 lathe to mach4 lathe has been painful.  Learning another programming language, errors in the screen sets, lack of documentation as to Mach4's model (lua running screen, lua running core, lua running scripts all in separate 'threads' that don't talk to each other nicely), lack of documentation on the detail of the wizards...

Having said that I wouldn't go back to Mach3 lathe.  Standardizing on Fanuc style Gcode and macros means there is a lot of information available.  The screen editor, once you learn where to find properties and actions and events allows you to customize to your hearts content.  Hardly anyone uses Mach4 lathe yet so it is much more difficult to get forum support but thanks to guys like Craig who are willing to go above and beyond their own interests to help teach and explain has allowed me to have made great progress in understanding the new paradigm.

It is unfortunate that we have lost some of the knowledgeable users like Franco who has moved on to Centroid.  He was a valuable contributor to Mach3 lathe users but when I looked at Centroid I found that you could not customize their screens in any fashion, they didn't have an API available either so that was not an option for me.  It is heartening to see Rich post here with his vast knowledge on CNC lathes.  I understand that when you have invested hundreds of hours making things work the way you want the thought of moving to something new means not only redoing everything but learning how to do those same things in a new way.  Hope he sticks around.

If, as a hobbyist, all you want to do is run Gcode files then Mach4 does that.  The gripe on hardware integration is valid but getting better, but, unless your willing to buy ALL of the hardware, including the machine, as what happens when you be from an OEM, you will always have to configure according to what you have put together.  Of course you could always switch over to the Linux based CNC, but then you would have to learn another language, operating system, screen paradigm, hardware setup and configuration and rely solely on user support ;^)

MTCW

RT

364
Mach4 General Discussion / Re: Lathe Tool Table Setting Tools Help
« on: January 16, 2018, 06:01:24 PM »
One of the reasons you're not getting a lot of help on this is that there are very few of us using Mach4 with a lathe.  I'm just learning how to use the tool table so take everything I say for what you're paying for it.

I assume you are working in the 'diameter mode'.

I think I understand your method as that was how I started as well.  What I found was that after taking your micrometer measurement, as long as you had actually issued a t0202 command, so that that is the active tool and the active offset, you could, open the tool table and select the Tool#2 X cell and then enter the mic measurement in the lower left input box and hit the 'Measure' button.  Your X offset will change by half of the difference of what was expected and what was measured (tool table reflects radius offset) and the dro will now read the mic'd measurement.

This works for me.

HTH

RT
 

365
Mach4 General Discussion / Re: Lua Fails Me
« on: January 15, 2018, 02:07:00 PM »
Had to go blow some snow for the last hour, going to get to below 0 f here later.

Here now is the sum total of the m6691.mcs.  Deleted all bak and mcc in the macro folder and then started m4.


function m6691(hVars)
wx.wxMessageBox('hello')
--[[
 local rt = require 'rtMyModule'
  if rt== nil then
    wx.wxMessageBox('rt==nil')
  return
  end
  local xNow,zNow,maxVal,rc
  local ts,tr,te,sCode
  local currPos
  local plungeFeed=1
  local roughDOC=0.018
  local roughFeed=18
  local roughSpeed=800
  local finishDOC=0.018
  local finishFeed=18
  local finishSpeed=800
  local endX=.850 --param1()
 
  local inst=mc.mcGetInstance()
 
  if mc.mcSpindleGetCurrentRange(inst)~=1 then
    --rt.rtAudio("notify")
    --wx.wxSound('C:\\mach4Hobby\\Sounds\\Notify.wav',0):Play()
    wx.wxMessageBox('Set Spindle Gearing to High Speed')
    mc.mcSpindleSetRange(inst,1)
  end
  if (hVars ~= nil) then
    local DFlag = mc.mcCntlGetLocalVarFlag(inst, hVars, mc.SV_D)
    if(DFlag == 1) then
      endX = mc.mcCntlGetLocalVar(inst, hVars, mc.SV_D)
      mc.mcCntlSetLastError(inst,"Turning Diameter to "..endX)
    end
  end
  xNow,rc = mc.mcAxisGetPos(inst,0)
  zNow,rc = mc.mcAxisGetPos(inst,2)
  if xNow<=endX then
    rt.rtAudio("chord")
    wx.wxMessageBox("start X diameter "..xNow.." is <= to end diameter of "..tostring(endX))
    return
  end
  if zNow<=0 then
    rt.rtAudio("chord")
    wx.wxMessageBox("start Z is less than or = to 0")
    return
  end
  ts=os.time()

--rough cuts 
  mc.mcCntlGcodeExecuteWait(inst,"M3 S"..tostring(roughSpeed).."\ng04 p3.0")
  currPos,rc=mc.mcAxisGetPos(inst,0)
  while ((currPos-2*roughDOC)>(endX+finishDOC*2)) do
    maxVal=math.max(endX+2*finishDOC,currPos-roughDOC)
    sCode="G01 F"..tostring(plungeFeed).." X"..tostring(maxVal-roughDOC)
    mc.mcCntlGcodeExecuteWait(inst,sCode)
    currPos,rc=mc.mcAxisGetPos(inst,0)
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(roughFeed).." Z0")
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      rt.rtAudio("chord")
      wx.wxMessageBox("Spindle Stopped")
      return
    end
    currPos,rc=mc.mcAxisGetPos(inst,0)
    maxVal=math.max(endX+2*finishDOC,currPos-roughDOC)
    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
      rt.rtAudio("chord")
      wx.wxMessageBox("Spindle Stopped")
      return
    end
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(roughFeed).." Z"..tostring(zNow))
    if (currPos)==endX+2*finishDOC then
      break
    end 
  end
  tr=os.difftime(os.time(),ts)/60
  mc.mcCntlSetLastError(inst,"Roughing Time: "..string.format("%.1f min",tr))

  --finish cuts
  mc.mcCntlGcodeExecuteWait(inst,"M3 S"..tostring(finishSpeed))
  while (mc.mcAxisGetPos(inst,0)>=(endX+finishDOC)) do
    currPos,rc=mc.mcAxisGetPos(inst,0)
    maxVal=math.max(endX,currPos-finishDOC)
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(plungeFeed).." X"..tostring(maxVal))
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      rt.rtAudio("chord")
      wx.wxMessageBox("Spindle Stopped")
      return
    end
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(finishFeed).." Z0")
    currPos,rc=mc.mcAxisGetPos(inst,0)
    if currPos==endX then
      break
    end 
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(plungeFeed).." X"..tostring(endX))
    if mc.mcSpindleGetSensorRPM(inst)==0 then
      rt.rtAudio("chord")
      wx.wxMessageBox("Spindle Stopped")
      return
    end
    mc.mcCntlGcodeExecuteWait(inst,"G01 F"..tostring(finishFeed).." Z"..tostring(zNow))
    currPos,rc=mc.mcAxisGetPos(inst,0)
    if currPos==endX then
      break
    end 
  end
  mc.mcCntlGcodeExecuteWait(inst,"M5\nM9")
  te=(os.time()-ts)/60
  mc.mcCntlSetLastError(inst,"Roughing Time: "..string.format("%.1f min",tr).." - Total Time: "..string.format("%.1f min",te))
  local subj='Lathe'
  local msg='Roughing Complete'
  rt.sendSMS(subj,msg)
--]]
end

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



Guess what,  it still ran the old macro code that doesn't exist!!!

 

366
Mach4 General Discussion / Re: Lua Fails Me
« on: January 15, 2018, 12:28:28 PM »
Hi Daz,

Yes I am using it.  I have another macro, m6000 that calls one of the functions and it works,

function m6000()
rt = require 'rtMyModule'
if rt== nil then
  wx.wxMessageBox('rt==nil')
  return
end
local subj='Lathe'
local msg='test m6000'
rt.sendSMS(subj,msg)
end

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

So it seems that rtMyModule located in the profile's 'modules' directory is successfully compiled and loaded by this macro.

Does this help narrow down the problem?

367
Mach4 General Discussion / Re: Lua Fails Me
« on: January 15, 2018, 11:02:47 AM »
I did not find a lua.mcc on my machine but I did find a mcLua.mcc.  I deleted it, after shutting down m4, and the result was the same.  I then deleted all mcc and bak files and restarted m4, the result was the same. 

I have searched the computer for any files of m6691* and found only the mcs and new mcc created on reload.  I have changed the feeds and speeds in the m6691 script and can confidently state that the file is not being run.   It's as if m4 has retained a compiled version somewhere else.  I am totally baffled on this one.

368
General Mach Discussion / Re: Edit X Position (newb, be gentle)
« on: January 15, 2018, 10:52:17 AM »
If my daughters had asked that question they would also have said, 'Dad, give me the short answer'.

Short answer, yes, this is the version for sale, I have cut a 27mm 1.5mm internal thread for my spindle on a timing gear that worked the first time with the pmdx411 controller, yes there are a few other bugs.

The long answer.  Very few hobbyists are using Mach4(m4) in the lathe mode therefore very little attention is being paid to it.  NFS can't afford to provide the support to a hobbyist who paid $200 and they have been upfront about the amount of suppport to expect.  There are a couple of NFS people who monitor the forum and chime in when users get stuck and no one can help answer the problem.  I'm sure the industrial version has had more scrutiny. 

Because m4 motion control is now solely the responsibility of the hardware vendor it is unknown which and how  the functions have been implemented and tested.  When I switched to m4 earlier this year I had a uc100 controller and they advertised that they had a m4 plugin.  It turned out they had not tested it on a lathe and it did not work.  I don't know if they have subsequently upgraded their plugin.  The pmdx411 was a direct substitute that meant I didn't have to change any hardware or wiring so I tried that and have been pleased with its performance.  I don't know if any other vendor has implemented threading and tested it on a lathe.

The lathe version version will do most things that the hobbyist wants if they are using it in a traditional manor (run GCode files).  It is designed totally different from Mach3, implementing Fanuc gcode, lua as its scripting language and has a built in screen editor (that has a few annoying but not fatal bugs).  Learning the scripting paradigm and language has a steep learning curve.

Having said that I will not revert to m3.  I'm closing in on retiring and enjoy the challenge.

HTH

RT


369
Mach4 General Discussion / Re: Lua Fails Me
« on: January 14, 2018, 03:12:57 PM »
Further update:

copied and saved the m6691.mcs as m7791.mcs

ran m7791 from the mdi and nothing happened.

deleted the m6691.mcc and moved the m6691.mcs to another directory.  ran m6691 from the mdi and nothing happened.

copied the m6691.mcs back to the macros directory and ran m6691 from the mdi and it created the new m6691.mcc but still ran with the old finish numbers.

Any ideas?

RT

370
Mach4 General Discussion / Re: Lua Fails Me
« on: January 14, 2018, 02:42:04 PM »
Update:

Decided to give up figuring this out for now so I just deleted the wxMessagebox.

THEN, I changed the finishSpeed and finishFeed to be the same as the roughing feed and speed. Saved it and ran it from the MDI: m6691.  It ran with the old speed and feed for the finish cycle.  Deleted the m6691.mcc and ran it again.  Same result.  Shut windows down and unplugged the pmdx411, restarted windows and plugged the pmdx back in.  Deleted the mcc again and went into the editor checked to make sure that the finish numbers were the same as the roughing and they were, hit compile and the mcc was created again.  Ran it but it still ran the finish cycle with the old numbers!!!

I have searched the computer for any old copies of the mcc file and deleted those in a backup directory along with the mcs and removed them from dropbox as well.  How is it that it is running a file that no longer exists?

TIA

RT