CarbideMotion and UGS on Shapeoko - differences in G-Code?

I have a Shapeoko 3 XXL and CarbideMotion running on a Raspberry Pi touchscreen as a controller. I’ve had no issue with it. (Or none that weren’t due to user error…) I’ve added UGS (v2.0.11) to that Pi in preparation for using it with a J-Tech laser on the Shapeoko.

As a test for using UGS, I tried two files from Carbide3D to see if they’d work under UGS. One is the Hello world file that is intended to be run with a marker attached to the router and it writes out the Shapeoko logo on paper with the marker. The other file is the Endmill Tool Holder in the tutorials section on the Carbide3D site. Both forced UGS to stop near the start and report problems.

In the Hello World program, the line T1M6 makes UGS stop with an error message that the line contains an unsupported or bad Gcode command. In the Endmill Tool Holder file, I use the file for the 302 endmill and it stops at the line M6 T302 with the same error message.
saying it’s an unsupported Gcode. I did find a simple GCode file from elsewhere that I tried and it worked okay.

Does CarbideMotion use a superset of GCode commands? Why do these files work just fine with CM running the Shapeoko and they don’t work when run with UGS? I’m wondering why CM can handle these files just fine and UGS has issues with them. Am I going to find CM or UGS both run files the other can’t run?

M6 is not supported on GRBL. CM uses an internal macro to send something like

G53 (rapid to the toolchange position)
M1 (stop & show the toolchange message to user)
G53 (rapid to the bitsetter position)
G53 G01 Z___ F5 (to find the bitsetter)
G53 Z___ (raise up a bit)
G53 Z___ F1 (second touch)
G53 Z-5 (Rapid to clearance plane)
G53 (rapid back to tool change position
G54 (rapid to the first clearance position & execute the rest of the path)

I think you need to process the M6 in UGS somehow & send your toolchange routine to GRBL

1 Like

Carbide Motion interprets G-code and re-writes it on the fly as explained by @Tod1d so as to add support for G-code commands which Grbl doesn’t support — it should be possible to add support for tool changes to UGS, but that’s not something we can support — Will Winder &co. should have answers on it (but I’m not sure where discussion of UGS happens these days).

Doing a tool change, for what I was doing, is not really necessary. I just wanted to run a test file to make sure UGS was communicating properly with my Shapeoko. I guess I figured, since I’ve heard of a lot of people using UGS to control a Shapeoko, that UGS could handle files intended for the device. I get that this is not true now.

Can I assume the files I’m using were produced by CarbideCreate and that CC knows what CM uses, so when it slices a file, it is specifically preparing it for CM to use? (Since it knows what macros CM uses that aren’t available in other software?)

So I could add macros in UGS to do the same thing the macros in CM do? Is there a list anywhere of the macros built into CM? And can I make CC output a file that is only GCode so UGS can handle it?

I’m not sure who Will Winder is, but I have tried to search for a UGS forum. The developers don’t provide one. The code and downloads are hosted on GitHub, but I didn’t see a connected forum. Also no forum on Reddit. I was hoping to find a UGS specific discussion board.

This at least answers my basic questions and now I’m not worried about UGS not handling those files. It does make me wonder if it would be possible to set up macros in UGS to handle these extra commands in .nc files for my Shapeoko. Or, on the other hand, if I had a list of the macros and commands CM handles (and what they do) and that UGS does not, then when I have time and have a better understanding of GCode, I could write up a Python script that would take a .nc file and find the non-GCode commands and replace them with sequences that do the same thing.

Will Winder is the original author of Universal G-code Sender.

Here is a discussion forum for UGS:

https://groups.google.com/g/universal-gcode-sender

Try selecting the Basic G-code post processor in CC and make a test file, should work.

Thank you! I’ll go there for UGS questions in the future. Much appreciated!

Okay, that sounds good. (And I still, when I get time, would like to set up something like I mentioned, so I could translate or use GRBL files on UGS, but that’ll be a while and after I’ve had time to learn a lot more.)

Thank you!

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