Author Topic: Errors in G-Code Halting Process  (Read 25603 times)

Offline buggalugs

  • Ewok
  • *
  • Posts: 32
    • View Profile
Errors in G-Code Halting Process
« on: March 29, 2025, 18:54:20 pm »
Once again I have hit a road block and struggling to find an answer. My Mill is a small 3036 GBRL driven by UGS. My Code is derived by CamBam. I am attempting to machine a facia for my new lab variable PSU, the medium is 0.8mm MS panel. 

The first problem which causes a halt is the instruction T7 M6 (8 lines from the top) I'm not sure what is wrong  with this.

After that it continually stalls after a few seconds. What am I doing wrong?

I have taken the liberty of appending the code and the error output displayed in the UGS Console, hopefully some kind person will point ot the errors of m my ways. :o 

God created Ale to make us all happy!

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7577
    • View Profile
    • Cambam V1.0 French Doc
Re: Errors in G-Code Halting Process
« Reply #1 on: March 29, 2025, 19:17:07 pm »
Hello

Quote
The first problem which causes a halt is the instruction T7 M6 (8 lines from the top) I'm not sure what is wrong  with this.

It is because GRBL do not handle toolchange (M6). Also it do not handle other current codes like G83 (peck drilling) and others ...

GRBL as been first designed to drive laser engraving machine and some code for milling are missing (not enough room in the Arduino memory !)

Use the post processor called GRBL_no_tc (no toolchange)

https://cambamcnc.com/forum/index.php?topic=9069.msg71221#msg71221

https://cambamcnc.com/doc/1.0/cam/post-processor.html#install-a-post-processor-downloaded-from-the-internet

Because tool changes are not handle by GRBL, you must produce a separate GCode per tool used ;)

You can also try to drive the machine directly with CamBam instead UGS with this plugin.

http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/GRBLmachine.html

Another way is to use bCNC instead UGS because bCNC contain macros to handle the M6 and the G83.

++
David
« Last Edit: March 29, 2025, 19:20:54 pm by dh42 »

Offline buggalugs

  • Ewok
  • *
  • Posts: 32
    • View Profile
Re: Errors in G-Code Halting Process
« Reply #2 on: March 30, 2025, 13:54:33 pm »
Thank you so much for the reply. I have given the CamBam GRBL Machine a good try but I don't seem to have any immediate success. A completely new learning experience which will take me a lot of time to get used to.

Of my three CNC Machines a Silhouette Cameo Cutter and a 3D Printer all of which use G-Code The only one's which gives me Coding issues are the GBRL 3036 and Fox Alien Masuter.

I would love to stick with my good old Mach3 but only one of my machines talks Parallel Port Coms. all the others only talk USB, Yes I know, buy Mach4 but hey man I have spent a small fortune on Software.

I have to put this into perspective also, I am NOT a trained CNC Machinist quite the opposite. I have spent my life working life in the electronics industry then Teaching Mathematics' in high school. This is a hobby.

Switching Off The MOP's in turn has allowed me identify the problems down to hole cutting, sometimes it works without stopping othertimes it stops after one cutting revolution.
God created Ale to make us all happy!

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7577
    • View Profile
    • Cambam V1.0 French Doc
Re: Errors in G-Code Halting Process
« Reply #3 on: March 30, 2025, 21:10:28 pm »
Hello

Quote
I would love to stick with my good old Mach3 but only one of my machines talks Parallel Port Coms. all the others only talk USB, Yes I know, buy Mach4 but hey man I have spent a small fortune on Software.

Mach3 is also able to drive USB or ETH motion controller, IF the board manufacturer provide the suitable plugin. There is more plugins for Mach3 than for Mach4 !

If the machine use a GRBL controller, it is not possible to drive it with Mach3 or Mach4, the controller must be replaced for a Mach3/4 USB or ETH compatible one.

++
David

Offline Garyhlucas

  • CNC Jedi
  • *****
  • Posts: 1474
    • View Profile
Re: Errors in G-Code Halting Process
« Reply #4 on: March 31, 2025, 21:44:28 pm »
Thank you so much for the reply. I have given the CamBam GRBL Machine a good try but I don't seem to have any immediate success. A completely new learning experience which will take me a lot of time to get used to.

Of my three CNC Machines a Silhouette Cameo Cutter and a 3D Printer all of which use G-Code The only one's which gives me Coding issues are the GBRL 3036 and Fox Alien Masuter.

I would love to stick with my good old Mach3 but only one of my machines talks Parallel Port Coms. all the others only talk USB, Yes I know, buy Mach4 but hey man I have spent a small fortune on Software.

I have to put this into perspective also, I am NOT a trained CNC Machinist quite the opposite. I have spent my life working life in the electronics industry then Teaching Mathematics' in high school. This is a hobby.

Switching Off The MOP's in turn has allowed me identify the problems down to hole cutting, sometimes it works without stopping othertimes it stops after one cutting revolution.

I just pulled a USB motion controller for Mach 3 out of my machine and replaced with an Acorn.  It was working fine, the computer died and I wanted some features that Acorn could do but not Mach 3 so replaced both at the same time.  Yours for free if you send me your address.
Gary H. Lucas

Have you read my blog?
 http://a-little-business.blogspot.com/

Offline alex_holden

  • Droid
  • **
  • Posts: 50
    • View Profile
Re: Errors in G-Code Halting Process
« Reply #5 on: April 01, 2025, 05:19:26 am »
Regarding tool changes, either output a separate g-code file for each tool or switch to a g-code sender that handles M6 tool change instructions in a sensible way. I wrote my own that basically just pauses the program, allows you to do a manual tool change (including jogging), then resumes the program without sending the M6 line out to grbl.

Regarding error 33, I have run millions of lines of CamBam-generated code through grbl and have never seen this error, but apparently it can be caused by excessive rounding, i.e. not enough precision in the numbers sent in the g-code commands:
https://softsolder.com/2020/03/18/grbl-error-33-arc-coordinates-vs-decimal-places/
Basically the code is telling grbl to move through an arc that is physically impossible. This might either be a problem with the postprocessor you're using (I use a slightly altered version of the included GRBL post), or your g-code sender might be rounding-off the numbers before it sends them.

The postprocessor I'm using has the "Number Format" parameter set to "0.0###" which causes it to output 4 digits of precision. My g-code sender doesn't do any rounding.

I don't believe it's true that grbl was originally written to control laser cutters. It was originally meant to control basic 3 axis routers/mills and the laser-specific features were added much later. It does lack some advanced features such as macros but there's no reason you can't use it with CamBam to drive a router.

Offline lima

  • Ewok
  • *
  • Posts: 32
    • View Profile
Re: Errors in G-Code Halting Process
« Reply #6 on: April 02, 2025, 19:16:18 pm »
I still use UGS 1.0.9 even though it is old it allows you to use the default Cambam postprocessor, it is true that it has less functionality than the new version but that's fine, the advantage is that it does not stop the machine with M6 even if it reports an error in the gcode list and it allows you to change the tool if you use M5 at the end of MOP and G4Pxxx.

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 9079
    • View Profile
Re: Errors in G-Code Halting Process
« Reply #7 on: April 02, 2025, 20:34:18 pm »
Custom post-processors are so easy to write for CB, it's hardly worth it to put up with problems like that.  Just take the one that 'almost works', and modify it with the codes your machine needs. Fix your post to match your machine!

L
"Pyro for Fun and Profit for More Than Fifty Years"

Offline buggalugs

  • Ewok
  • *
  • Posts: 32
    • View Profile
Re: Errors in G-Code Halting Process
« Reply #8 on: April 04, 2025, 12:58:35 pm »
Further to my quest I have spent the last four days researching the prospects of replacing both GRBL Breakout Boards (BOB's) for Parallel Port BOB's and running Mach3 - This is becoming frightening :o

It is doable with my 3036 ( modified 3018 ) but my Fox Alien has closed loop Servo's and I don't have a Scobie where they hang into on the BOB or as daft as it may seem go directly to input pins

Has anyone converted one of these beasts or am I talking twattle again?
God created Ale to make us all happy!

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 9079
    • View Profile
Re: Errors in G-Code Halting Process
« Reply #9 on: April 04, 2025, 15:00:46 pm »
I guess we (collectively) don't understand your motivation.  Mach3 will talk over USB.  Why must you convert to parallel?

Surely someone in those two communities has written the necessary intermediary drivers to do it.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"