Mach 4 lua capabilities

Pro versions of Windows allow you to disable automated updates.

The only two versions of Windows I would run Mach4 on is Windows 7 and 11. I would advise Windows 11 Pro specifically because you can then base your automated updates off an organizational level.

In fact, when you install using the AvidCNC installer you will find they give an organizational level update policy and disable automated updates with the exception of system monthly (also known as “mandatory”) updates.

Most Windows 10 have patches installed for Meltdown and Spectre exploits which makes them uniquely unfit for RT operations like CNC operation. These exploits are hardware exploits so the software can take as much as 35% of your CPU checking operations and clearing L2 cache. And no, you cannot undo those patches.

Windows 7 never got the update of course so there is that little nugget.

With W11 you can disable many more services that you ever could before. This trend is from the stick and card pack sized PCs.

My CNC PC is a MeLE 8GB 128GB 4 core Intel Celeron J4125. So absolutely tiny computer. It is smaller than the 8 port ethernet hub it sits on. No fan to suck in dust either. It runs Mach4 just fine. Don’t need to turn off wifi or anything like that. You can buy one off Amazon for $175 with Prime shipping.

Glad to hear that! Looking forwards to hearing more about it.

I work in Enterprise IT as my profession. I understand how to control systems well. I run pro on everything I have. I tend to wait until things settle before upgrading. Especially because my design computer is too time consuming to fix after a full os update. Installing from scratch takes even longer. Dev environments are hard to keep between setups. Fusion is no issue at all but, zbrush and all of the plugins take way too long to get back into. Blender, even with plugins that attempt to back up.

My current CNC machine is running 1607 ltsc and that is way before the patches for the exploits. I just kept it that way because mach3 was an issue on a couple other machines with lock up.

I’m going to look into that stick you mentioned. I do have a nuc from a few years back. I’ll have to make sure it has a TPM chip first. I have it for Kali Linux but, just started running that on a portable pi setup instead.

On to my M6 scripting adventure. Yesterday I spent several hours attempting to get everything working. I tend to keep at things until I can’t recognize that I shouldn’t keep going.
I definitely over thought the process though. I think it’s because I was learning how to use lua and attempting to create everything at the same time. I had too many variables and too many findings doing math on these things. I stopped at some point, in frustration. I kept trying to find a way to set the machine offsets because there is a set command for it. Fairly certain it isn’t implemented though.

Then, while having some drinks with friends and not thinking at all about this, it just popped into my head. As soon as the answer came to me, it made perfect sense.

This morning I removed a bunch of variables and functions. I realized last night that I didn’t need to know any measurement between the two touch plates at all. I only needed to set up a tool by finding the z0 of the work and then touching the fixed plate and storing that position. Z0 just got setting up before the job and the plate being the current position with that tool in it.

Then on my the tool moves to a tool change location, changes tools and goes to the fixed plate. When that touches, store that location and set it to over write the original location at that same position. That’s it! Duh.

I think part of it was that I was attempting to do a similar thing that my mach3 screenset did. Not necessary though.

I then modified the screenset to allow you to move to a position you want to change tools at, store that position and did the same for the fixed plate. Added buttons for that as well as adding buttons to move to those positions if wanted.

The scripts I made make sure to move to machine z0 before the moves and give some prompts to remember to do certain things before it happens.

I need to clean things up a bit and document a little better. I also haven’t tried listening for probe trigger the way you showed up above. I was trying to get things working with what seemed to work already.

I will say that it seems that using g31 at certain speeds takes some amount of time to trigger that could throw off the measurement. Does the method you gave trigger faster? I’m not moving fast now and especially not on the second move. It probes for the plate at 25ipm and then backs off a tiny amount and probes again at 2ipm. I have inputs on screen to change these speeds and distances.

When I moved at 40ipm, it was able to knock the plate out by a few thou before stopping.

Once I clean up the setup some more, I’ll post a link to my GitHub where everything will be. The other thing I’m not liking about mach4 is the method of moving things into a setup. Seems that the easiest is to use the full profile folder and screen file. If someone has a custom setup already, they would have to modify the ini holding all the variables, add buttons and then add the scripts individually to those buttons. I would have to save each of those scripts separately to copy into those screen buttons. I haven’t gone into modules yet. Maybe that would help. Pop up windows over the screen instead of using the screen itself.

Here is the Github with everything in it. @jjneeb check it out if you want to try it for yourself. I am sure the code could be better. I am just happy it works well. I could make it prettier as well.

Thanks, I appreciate your effort to document things too. Too many people just get it working and don’t write it down. I like where you put your tab for this, lots of screen real estate there. I may have to move my laser offsets tab up there because I’m running out of room in the lower left one.

jim

Awesome. I’m glad you like the layout.
I first started in a smaller tab and decided it wasn’t enough. Also, I copied buttons from one page that do not function. I need to replace them with scripts that work. The home all axis and move to xy 0

Didn’t I send you that code already? I have the same function but with all three values, x y and z if you need it.

Yes, you used pound variables to do it right? I found a list of them and then I watched the variables change as I tested moving around and setting things manually to see what I should be looking at in the pound variables. Then I saw a set pos call that exists for machine location and it does not work. It exists, does nothing though. Then I realized I did not need the actual machine coordinate to be set. I just needed to update the current work offset coordinate to match the first probe location once I change tools and probe. It is a super simple way and requires nothing but capturing the first position and the later setting the current position to that first position.

Just a little update I had to make to things.
I was testing everything out again this morning and found an issue. It is all fixed in the updated code I have on git.

I was replacing the z offset with an updated value. Instead, I actually needed to ignore that value other than knowing where it was. The m6 script now just uses the original z height of the second plate for all tool changes after that. It always has to equal that height to stay at the right height for the setup.

I also realized that I was storing the z machine height before entering the tool change. This would return it to a higher or lower position depending on tool size. I changed that to store the offset z height and go to that position after tool change occurred. This brings it back to where it actually started the m6 with the new tool lengths.
It fully works now. I have tested for the past hour with different tools to be sure.