Hello Guest it is September 25, 2020, 12:36:26 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 - lesspaul

Pages: 1
For a long list of reasons I have not been able to use my CNC for a while, and am happy to be getting back at it.
My current installation is Mach4 Industrial version and Warp9 ESS version 232.

I am assuming I can simply update to newer versions without major issues -- is this a valid assumption?
And I know that -- at least in the past -- the official Mach4 release can be quite a bit behind from what many are using.  Looking for any advise as to what would be my best bet (version) in terms of upgrading.

Much thanks in advance -- Paul

Ethernet Smoothstepper is currently compiled against Mach4 version
However the downloads page still has and for Hobby and Industrial respectively.
The FTP site has versions through 4118

Any idea where I could find 3882 Industrial?

PS: It looks like there is a lot of development activity!

Mach4 General Discussion / My new screenset (and thanks to all)
« on: June 23, 2018, 06:03:53 PM »
Attached is a screenshot of my new screenset -- clearly inspired by the Mach3 "Screenset 2010".
The HOME and ZERO buttons turn green when homed/zeroed.
Pressing "Zero to Laser Crosshairs" sets Zero to the proper offset for my gantry mounted laser pointer, and turns X/Y Zeros green.
Pressing "Probe for Tool Zero" launches a coroutine script which does a fast then slow probe and sets Z-zero (and turns Z Zero green)
M6 is highly customized
1) Checks to ensure machine has been homed -- error if not
2) Records current X/Y, feed, and modals
2) Moves to Z0,  fixed plate loacation
3) If 1st M6 following "Probe for Tool Zero" then fast/slow probes plate for offset and returns to Z zero
4) Prompts for tool change and then fast/slow probes for zero and applies offset.
5) Returns to Z0, rapids to starting x/y and restores feed and modals.

Feedback and constructive criticism much appreciated

I've read conflicting information in the forums regarding the #vars .
Which #vars are safe for user functions?
Are any persistent (saved at Mach4 shutdown / reloaded at Mach4 startup)?   

Mach4 General Discussion / Can't seem to get load_modules.mcs working
« on: June 17, 2018, 11:42:37 AM »
RHTuttle posted in January about launching functions as coroutines from his scripts using load_modules.mcs to load his custom module, a user module, and a button script

I had no success trying to duplicate his efforts. I reduced my code to a minor test case, and it seems that I'm doing something wrong regarding load_modules.mcs.

The file 'load_modules.mcs' in my profile's '\Macros' subdirectory
Code: [Select]
-- Load modules that you want to be able to use from Mcodes
inst = mc.mcGetInstance()
local profile = mc.mcProfileGetName(inst)
local path = mc.mcCntlGetMachDir(inst)

package.path = path .. "\\Profiles\\" .. profile .. "\\Modules\\?.lua;" .. path .. "\\Modules\\?.lua;"
--package.path = path .. "\\Modules\\?.lua;" .. path .. "\\Profiles\\" ..  profile .. "\\Modules\\?.lua;"

--ErrorCheck module
package.loaded.mcErrorCheck = nil
ec = require "mcErrorCheck"

ph = require "phModule"     -- resides: C:\Mach4Hobby\Profiles\MyCNC\Modules

'phModule.lua' in my profile's '\Modules' subdirectory.
Code: [Select]
local phModule = {}

   function phModule.bigMac()
      mc.mcCntlSetLastError(inst, "Special Sauce?")

return phModule

Button code
Code: [Select]

When I activate the screen button, I get the following error message:
C:\Mach4Hobby\ScreenScript.lua:1029: attempt to index global 'ph' (a nil value)
stack traceback:
   C:\Mach4Hobby\ScreenScript.lua:1029: in function <C:\Mach4Hobby\ScreenScript.lua:1028>
However, if I add the load_modules code to the Screen Load Script, my button functions as expected.
Code: [Select]
--My Stuff (Paul)
ph = require "phModule"

Yes, I got the code working, but I'm perplexed as to what I was doing wrong initially. Any and all help much appreciated.

I have a state flag that I need to be accessible in multiple scripts.

It looks like this could be done by creating a register in the register plugin or I could create a LED on the screenset and use its state to communicate. Or ??

Related questions
-- what are the differences between an "instance" and a "global" register?
-- is there a hook to trigger or launch a script when a new g-code file has been loaded?

Mach4 General Discussion / Reset required after G31 probing moves?
« on: June 14, 2018, 03:10:32 PM »
I am seeing something that seems unusual to this Mach4 newbie. I just got done writing my second script -- tool zero probing -- and found a strange behavior. Following a G31 probing move the MDI is disabled.  Test code:

Code: [Select]
mc.mcCntlGcodeExecuteWait(0,"G91 G31 Z-2.0 F5.0)
however, if I press [Reset] or add mc.mcCntlReset(0) to the script all is well and the MDI works as expected.

Code: [Select]
mc.mcCntlGcodeExecuteWait(0,"G91 G31 Z-2.0 F5.0)

I am using the most recent release version of Mach4 ( and Ethernet Smoothstepper with firmware #220.

So my questions are: Is this normal? And if not, which is the most likely culprit, something I did, Mach4 or ESS?

For completeness sake, here is my entire tool zero script:

Code: [Select]
local inst = mc.mcGetInstance();

local TouchPlate = 0.622 -- Thickness of touchplate above material
local SlowProbeRate = 0.7  -- IPM
local FastProbeRate = 5.0  -- IPM
local JogRate = 60
local Pos

mc.mcCntlSetLastError(inst, "Probing for Z Zero . . .")
wx.wxMessageBox("Ensure touch plate properly positioned and connected, then press ENTER.")

mc.mcCntlGcodeExecuteWait(inst,"G91 G31 Z-2.0 F".. FastProbeRate)  -- Probe TouchPlate at FastProbeRate
mc.mcCntlGcodeExecuteWait(inst,"G91     Z0.05  F".. JogRate)        -- Retract
mc.mcCntlGcodeExecuteWait(inst,"G91 G31 Z-0.07 F".. SlowProbeRate)  -- Probe TouchPlate at at SlowProbeRate

Pos = mc.mcAxisGetProbePos(inst, mc.Z_AXIS, 0)  -- Get Touch Position (work coordinates)

mc.mcCntlGcodeExecuteWait(inst,"G90 Z".. Pos .. " F".. SlowProbeRate) -- Move back to touch point in case of overshoot
mc.mcAxisSetPos(inst, mc.Z_AXIS, TouchPlate) -- set DRO to height of touchplate
mc.mcCntlGcodeExecuteWait(inst,"G91 Z1.0 F".. JogRate)        -- Retract

wx.wxMessageBox("Z Zero Set. Remove touch plate and press Enter")
mc.mcCntlSetLastError(inst, "Z Zero set")


After sitting on a license for several years I'm finally going to give Mach4 the old college try, but I'm pretty wedded to the simple and multi-tool zero functions in Gerry's 2010 screenset, as well as his X/Y zero to laser crosshairs feature.

I'm well aware that in cases such as this, Lua is my friend, and I'm no stranger to coding. However, there is never a point to reinventing the wheel so I thought I'd ask if anyone already has scripting similar in function. If not, time to knock the dust off my ol' friend UltraEdit.

(DaTheGas -- I've already seen your excellent youtube videos on modifying M6!)

-- Paul

I did some work for a fellow to get his new CNC up and running and was given an Ethernet Smooth Stepper in thanks. When I bought my Mach3 license there was a special deal on licenses for the still new Mach4 and I bought both but have not used Mach4.
My old serial port PC is getting old and it is time for upgrading. My use is a three axis router. Is there any reason NOT to go with the Smooth Stepper? It seems that Newfangled recommends several notion control boards, but smooth stepper isn't on the list and I was wondering if there was a good (technical,) reason why.

Pages: 1