Macros For My Workflow UPDATED: 2023-10-27

Something that you should understand. What I’ve done here is done for my workflow and my machine. If you attempt to use what I provide here, you must be responsible for making adjustments that work for your machine.

The best place to start is at the beginning, and I hope you don’t mind how verbose this story is. :smiley:

I found myself going through this repeating dance between putting in a bit, moving to the zero block, moving off-table to adjust my zero for the thickness of tape & CA glue holding my project to the wasteboard and going back to my project’s XYzero to start the cutting.

DING! That’s why macros exist! (That voice in my head said, ā€œWhy’d it take you so long?ā€ :smiley: )

I cludged together some gcode and found something that worked … only I was never really happy with it. So, the OP on this thread gave me the incentive to rework my macros. In addition, I’ve found my workflow extending to other parts of my wasteboard using most of the other defined Workspaces - P1 - P6. I generally have fixtures for different products spaced around my machine where each one is defined within a Workspace.

I’m still not happy with the results in at least one area, but more on that later. My workflow on lots of projects is similar to the way I described it above:

  • Home the machine
  • Load my Workspace coordinates
  • Move to the desired Workspace’s XY
  • Prepare the part and the bit to use
  • Move to a fixed machine zero reference point
  • Perform the Z-Zero procedure
  • Move off-table (for bit clearance)
  • Go to Z-Zero
  • Jog the Z up by 0.010" (two tapes & CA glue)
  • Zero Z at this new position
  • Move the bit up for clamp clearance
  • Go to XY0 in my current Workspace
  • Start the job

And all of that has to be aware of what Workspace I’m using which I keep track of (most of the time), but a macro has to have a programatic way to do the same.

I did make you aware of the verbosity in this post! :smiley:

So, this ended up being three different macros for my workflow. The first one handles loading Workspace coordinates. (This one started while I was transitioning from Carbide’s CM sender. It irrationally resets some coordinates as it is closing that gave me problems until someone on this forum set me straight.)

The second macro moves the bit into the area where I do Z-zero with a block. The third macro is the one that actually makes the Z adjustment for tape and glue.

Each one of the macros will save the current Workspace address, do what it does and return to the saved address. Each macro is heavily commented, but I remove all comments when I install it into gSender. I’ll provide the text of each macro inline, but I will also attach the text files.

The next post explains some of the problems I encountered and discusses improvements.

After that, there are 3 posts with the gcode for a macro, and the downloadable text for that macro.

If you notice a way to improve something, that won’t make me mad even a leetle bit! :smiley: Please quote something out of the post you have a response to so it will be easy to keep up with them.

4 Likes

@CrookedWoodTex Great work, Tex. These are so far beyond me that I can’t provide any educated comments.

One question, just FMI, do these all pre-suppose that the machine they are running on has limit switches?

The only limit switches my machine has are the ones used for homing. If one relies on limit switches, then one doesn’t quite understand the limits of one’s machine.

The key to doing these macros is to map out the coordinates of your Workspaces, and install those coordinates into the initialization macro. That just means to jog to the location and write down/transfer those coordinates. E.g. P1 = X Y; P2 = X Y; etc.

For more understanding, just read the comments and follow along in a gcode listing such as LinuxCNC.

I could go through these line-by-line if that would be instructive. My main reason for posting is to educate and take some of the ignorance out of the CNC. (BTW, the word ignorance is not a bad word.)

@CrookedWoodTex Tks, Tex. I, for one, am not offended by the term ignorance. I am ignorant about a lot of things. I don’t believe that I am stupid, though. :grinning:

I likely used the wrong term in saying ā€œlimit switchesā€. I don’t have switches of any kind on my LM. I asked only so that others would know if the functioning of the macros first required one to home the machine using switches.

M

So, I’m ignorant of a machine that doesn’t have a homing cycle. GSender won’t operate for me until its homed. All the homing cycle is doing is setting up the machine coordinates in Workspace G53. Well, its doing a bit more than that.

1 Like

@CrookedWoodTex Understood :grinning: My machine does not have a homing cycle as I have no switches. That was why I was posing the question - as I’m sure you understand.

1 Like

Hey @CrookedWoodTex, question for ya - since Oct 2023 and now, have you found that you can go back to having comments on your macro lines or is that still producing issues for you?

I’m curious because, if so, it’s likely something that can be fixed on our end

By the way, great macros and contributions! I recently revised our gSender docs to have more guidance on how to make macros so let me know if you read it over and have any comments:

Also, I’ve been curious about starting a github for community to contribute their own macros. Are you familiar with github and would you be comfortable with posting and updating your macros through there? If people distribute their macros on here I feel like it can become more fragmented but it’s still something I’m not fully sure on. Let me know your thoughts or if anyone else want to comment please join in :+1:

Chris, its a wonderful feeling to have some recognition by you folks!

I’m familiar with Github, as I’ve been programming off and on for most of my life, but I really don’t have enough time to take off on programming again.

Testing my macros is near dangerous on my old (2019) Shapeoko. :smiley: Maybe when I can get that new AltMill, I can cram a bit into the wasteboard and walk away! :smiley:

I’ll do a little test on the comments in my macros since I’m finishing up the last project before I close down for a much needed maintenance cycle for my whole workshop. I need more room! :smiley:

And, I’ll spend some time in the close future and read up on your posted document link.

That’s about all I can promise right now. Thanks again!

3 Likes

19 posts were split to a new topic: Macros for probing function

I’ve now made an experimental section for user macros now, feel free to check it out @CrookedWoodTex, hopefully you find it’s not as hard to edit as you thought (though you’ll need a GitHub account to do it)

2 Likes