"Macros" in Carbide Motion

Not exactly a macro, but I would like CM to check a directory for an executable file that has the same name as the letters for current Gcode instruction, passing the arguments to the executable.

Once the executable has finished executing, then send the instruction to the machine.

This could be used to contextually run utility programs to do a variety of useful things… such as turn a light on to say it’s okay to change the tool:)

Hasn’t a version of you last point been suggested before where CM could even just flash a warning after comparing the global coordinates versus the work coordinates and project travel extents. A soft warning saying that the file exceeds the work envelope would be a nice feature.

1 Like

I would like Macros to be usable as variables. List the variables in the beginning of the program or a separate page. #100 = 24 #101=12 and so on.
The program would be edited to look like.
G01 X#100 Y-#101
This would allow for one program to be used for various sizes of the same parts. or to create repeatable patterns by having math functions in the program. G01 X(#100+#103) or building macros #100=#100+10
This can also be used for thicker or thinner stock to add or remove passes.

2 Likes

Old programmer joke:

Claim: I am a hugely productive programmer! I write programs which are hundreds of thousands of lines long!

Rejoinder: You should learn to use loops.

variables, loops, math (including trig functions), conditionals — let’s make this Turing-complete.

2 Likes

Maybe not a macro, but I would like temporary offsets (G92) so I could use my laser engraver without having to rezero my WCS.

For macros, I would like one that I can use in conjunction with the above offset to turn laser mode $32 off and on.

I am using cncjs, which has some limitations but I can put gcode in the beginning of my laser nc files to turn laser lode on and add a G92 offset. And then at the end of the file, it cancels the offset. Can CM pass GRBL commands (ie $32=1) to the controller from within an nc file?

Any chance we might be able to keybind them, for those of us who use things like the Stream Deck?

2 Likes

Maybe, depending on how the initial rollout works.

4 Likes

Did you just let a cat out of a bag?

Nah, the cat was out of the bag already

3 Likes

We knew it was coming, unfortunately we just don’t know when??? As I flip between tabs on my browser looking at Aliexpress G-Penny spindles and C3D shop/community pages seeing if it’s mentioned anywhere… LOL!!!

3 Likes

Ok. I saw that. I also quickly forgot as I don’t have a pro.

I’m not in the know, but a spindle mount is a spindle mount, and the controller is common to all machines, so no reason why the future spindle could not be mounted on a non-Pro machine.

1 Like

Ahh. I see. If I recall it was in the context of a ‘pro’ thread. But yeah a spindle being a spindle makes sense.

1 Like

I fully agree with @nwallace and @Julien on pretty much every point they stated (and in the order of importance of their statements.)
Strong +1s all the way round :slightly_smiling_face:

To add along with Julien’s notes and others, here are some macros I would love:

  1. Probe conductive materials directly
  2. Probe holes in a material and use that as an XY origin
  3. Work offsets will be wonderful!
  4. I fully agree with Julien’s last post, running an air cut of the outside of a job might be helpful in ensuring no issues with clamps.
  5. Depending on fancy you want to get, macros to face material would be nice. Just input the size of the material and the desired WOC and DOC and CPT and off it goes.
2 Likes

This could be useful for surfacing the spoilboard.

1 Like

I wish so much I could use macro variable programming on my shapeoko! This is an example of a program I wrote for a job at my day job to be able to adjust rpm, chipload and depth of cut for a tool so we could adjust on the fly at the machine. I imagine grbl is far from being able to accomplish this but man does it make it nice! It is a WHILE DO loop that will essentially loop over and over until a condition is met.

“N18 G00 G17 G40 G80 G90
(.472 MM CARB HIGH FEED CUTTER)
(MM EFF120T4R1.8-4T08H -CUTTER)
(MM GRT-120C-T08 -SHANK)
(CAT50 ER32X4)
(ROUGH UNDERCUT)
#650=500(SFM)
#651=.009(FEED PER TOOTH)
#652=.015(DEPTH OF CUT)
#653=1.5/#652(STOCK TO BE REMOVED)
#653=[FUP[#653]](NUMBER OF PASSES)
#654=[[#653*#652]-1.5](FIGURING FOR Z STARTING POINT)
#655=[[3.82*#650]/.472](CALCULATING RPM)
#656=[[#6514]#655](CALCULATING FEED)
#698=1
#699=1
M911
T104T0 M6
G0 G54.1 P3 B270000
M3 S#655
G90 G0 X0.7239 Y1.6327
T105
M00
G43 H104 Z2.0
M131 (HIGH PRESSURE THRU SPINDLE ON)
Z0.1
G01Z#654F50.
WHILE[#698LE#653]DO1
IF[#699EQ2]GOTO101
G0 G91 Z-#652 F50.0
G3 G90 X0.914 Y1.7218 I0.0564 J0.1271 F#656
G1 Y1.7709
G3 X0.8717 Y1.8377 I-0.074 J0.0
X-0.8717 I-0.8717 J-1.8377
X-0.914 Y1.7709 I0.0317 J-0.0668
G1 Y1.7218
G3 X-0.7239 Y1.6327 I0.1337 J0.038
#699=2
GOTO102
N101
G0 G91 Z-#652 F50.0
G2 G90 X-0.914 Y1.7218 I-0.0564 J0.1271 F#656
G1 Y1.7709
G2 X-0.8717 Y1.8377 I0.074 J0.0
X0.8717 I0.8717 J-1.8377
X0.914 Y1.7709 I-0.0317 J-0.0668
G1 Y1.7218
G2 X0.7239 Y1.6327 I-0.1337 J0.038
#699=1
N102
#698=[#698+1]
END1”

2 Likes

What I would love to see is a fully open macro tab listed in the settings that needs to be enabled to show up ( an advanced settings tab with a disclaimer of voided warranty perhaps? ). I know myself and alot of other more seasoned hobby cnc users would like to be able to do full macros from the ground up for custom probing, chip clearing with higher rpm for a full sweep of the build plate, the ability to do hard lockouts for more accurate z facing ectect. While some of this can be done if you want to hack around code, Its 1000x time easier and more user freindly to just be able to write your own macro and let the machine run it. Not being able to run the machines probing the way you want and run 100% custom macros is this machines main weakness in my expirence. Sure we can move over to ugs but ugs in its own has its own quarks to deal with. The only other realistic option we have after that is to controller swap or spend 8x the amount of money on a pcnc440 that is almost never in stock.

1 Like

Another thought for a quick and easy improvement would be home positions above each of the holes in the threaded table. Like the current rapid move interface but instead of the Cardinal directions it’s just the thread table layout.
As I write this I realize it’s probably not a macro and it’s just a more general feature request…well it’s here already sooo…post.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.