Author Topic: GRBL post processor  (Read 22665 times)

Offline 10bulls

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 2150
  • Coding Jedi
    • View Profile
    • www.cambam.info
GRBL post processor
« on: October 21, 2013, 12:10:48 pm »
GRBL has certainly become popular in recent years.

I haven't yet tested this post processor on a GRBL, but if anyone would like to test and make suggestions for improvements, I would be very grateful.

The main change to this post from the default post processor is the replacement of drilling canned cycles with G0/G1 moves.

The 'Drill' post processor property is:
Code: [Select]
{$g0} {$_x} {$_y}
{$g0} Z{$mop.retractheight}
{$g1} {$_z} {$_f}
{$g0} Z{$mop.clearanceplane}

and 'Drill Dwell' is:
Code: [Select]
{$g0} {$_x} {$_y}
{$g0} Z{$mop.retractheight}
{$g1} {$_z} {$_f}
G4 {$p}
{$g0} Z{$mop.clearanceplane}

Peck drilling is currently not supported as this would require the post processor definitions to be able to handle more complex loops or scripts.
A post build command could be created to handle this.

I hope this post is useful starting point.

Offline gerritv

  • Ewok
  • *
  • Posts: 20
    • View Profile
    • Gerrit's Hobbies
Re: GRBL post processor
« Reply #1 on: August 08, 2014, 15:39:16 pm »
I am evaluating CamBam for use with a 3D router based on Velmex positioners and Grbl. So far all is well but there were a few items to tinker with on the Post.
Attached is an updated version.

I will look at creating a custom post script for peck drilling, probably in vbs as opposed to Python

Gerrit

Offline gerritv

  • Ewok
  • *
  • Posts: 20
    • View Profile
    • Gerrit's Hobbies
Re: GRBL post processor
« Reply #2 on: October 06, 2014, 22:24:59 pm »
Still chipping away at actual testing on a machine. As a result of my dissatisfaction with the available GUI's for Grbl I wrote my own. It is more machinist-friendly and in the process shows off Grbl's real capabilities quite well.

https://github.com/gerritv/Grbl-Panel/wiki

Gerrit

Offline BR52

  • Wookie
  • ****
  • Posts: 333
    • View Profile
Re: GRBL post processor
« Reply #3 on: October 07, 2014, 19:29:08 pm »
Hello Gerrit,

Seeing your GrblPanel the present project written in Visual Basic.
I converted for my Visual Studio 2010 and only changed the RepeatButton component.
The source code you presented, is changed and lack RepeatButton on "GrblGui.vb"
The main window is not the same here:
http://www.cambam.co.uk/forum/index.php?topic=4274.msg31530#msg31530

Please put the correct source code.
Place your EXE here on the forum.

   Armando

Offline gerritv

  • Ewok
  • *
  • Posts: 20
    • View Profile
    • Gerrit's Hobbies
Re: GRBL post processor
« Reply #4 on: October 07, 2014, 20:29:31 pm »
The source code on Github compiles, works and is current. The exe is part of the zip file in the Release notes there.

I used VS 2103 Express. In your conversion to VS2010 you removed the Custom project (RepeatButton) but that has nothing to do with the button you pointed at. (The Solution has 2 projects, not 1)

Please raise questions/discussion on this at https://github.com/gerritv/Grbl-Panel/

Gerrit


Offline BR52

  • Wookie
  • ****
  • Posts: 333
    • View Profile
Re: GRBL post processor
« Reply #5 on: October 08, 2014, 00:05:58 am »
I will not argue with you Gerrit.

What is important you put the file "GrblPanel.exe"

People do not have the compiler to generate the "GrblPanel.exe"

   Armando

Offline gerritv

  • Ewok
  • *
  • Posts: 20
    • View Profile
    • Gerrit's Hobbies
Re: GRBL post processor
« Reply #6 on: October 08, 2014, 00:58:14 am »
That is why on the github site there is a Release page that has a .zip file (bottom left side) that contains the program and its files. Ignore the .zip and .gz with the source code.

Again, go here https://github.com/gerritv/Grbl-Panel/releases

I will not post the code in multiple places, and certainly not on the CamBam site.

Gerrit

Offline MrJTJinx

  • Droid
  • **
  • Posts: 58
    • View Profile
Re: GRBL post processor
« Reply #7 on: October 14, 2019, 12:28:21 pm »
How do i use the drill profile.
I have this postprocessor loaded and have selected the drill profile and tried to enter as many variables as i can.
when i view the gcode i still get the code as if i were using the canned cycle only the canned cycle instruction is missing.
what i expected was that the code would replace the canned cycle with a list of G0/G1 instructions that GRBL would understand as it doesn't have canned cycles in its firmware library.

Offline pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1739
    • View Profile
    • pixelmaker
Re: GRBL post processor
« Reply #8 on: October 14, 2019, 16:17:38 pm »
GRBL doesn't support the drilling/pecking G-Codes natively.
Supported G-Codes in v1.1
G0, G1: Linear Motions
G2, G3: Arc and Helical Motions
G4: Dwell
G10 L2, G10 L20: Set Work Coordinate Offsets
G17, G18, G19: Plane Selection
G20, G21: Units
G28, G30: Go to Pre-Defined Position
G28.1, G30.1: Set Pre-Defined Position
G38.2: Probing
G38.3, G38.4, G38.5: Probing
G40: Cutter Radius Compensation Modes OFF (Only)
G43.1, G49: Dynamic Tool Length Offsets
G53: Move in Absolute Coordinates
G54, G55, G56, G57, G58, G59: Work Coordinate Systems
G61: Path Control Modes
G80: Motion Mode Cancel
G90, G91: Distance Modes
G91.1: Arc IJK Distance Modes
G92: Coordinate Offset
G92.1: Clear Coordinate System Offsets
G93, G94: Feedrate Modes
M0, M2, M30: Program Pause and End
M3, M4, M5: Spindle Control
M7* , M8, M9: Coolant Control
M56* : Parking Motion Override Control

Be careful, G80 is used by GRBL as "Motion mode cancel". In G code, G80 is the "Cancel canned cycle".

ralf

Offline MrJTJinx

  • Droid
  • **
  • Posts: 58
    • View Profile
Re: GRBL post processor
« Reply #9 on: October 15, 2019, 22:39:14 pm »
Thanks Ralf.

Unfortunately I am aware of the codes grbl uses.  this post starts with 10Bulls grbl post processor with a work around for grbl drilling but unfortunately I either don't know how to get it to work or it isn't working properly
please can you advise
« Last Edit: October 15, 2019, 22:41:13 pm by MrJTJinx »

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 5866
    • View Profile
    • Cambam French Doc
Re: GRBL post processor
« Reply #10 on: October 16, 2019, 00:00:46 am »
Hello

Quote
what i expected was that the code would replace the canned cycle with a list of G0/G1 instructions that GRBL would understand as it doesn't have canned cycles in its firmware library.

This is the case, but only for G81 and G82 (drilling and drilling with a break at the bottom) ; G83 (Peck drill) is not yet handled because there is currently no way to make math and loops with the post processor.

Remember that GRBL was not designed to drive a milling machine but it was developed for engraving machine (laser), so no needs for canned cycle or toolchange on this kind of CNC.

On the example file, if I use the Mach3 PP I get this Gcode for a hole of 10mm depth (simple drill and drill with 1s break at the end)

T5 M6
( Drill1 )
(  )
G17
S12500
M3
G0 X0.0 Y0.0
G0 Z5.0
G98
G81 Z-10.0 R0.0 F600.0
G80
( Drill2 )
(  )
G0 Z5.0
G0 X19.0
G98
G82 Y0.0 Z-10.0 P1.0 R0.0 F600.0
G80
G0 Z5.0
M5
M30

and if I switch to GRBL PP I get

T5 M6
( Drill1 )
G17
M3 S12500
G0 X0.0 Y0.0
G0 X0.0 Y0.0
G0 Z0.0
G1 Z-10.0 F600.0

G0 Z5.0
( Drill2 )
S12500
G0 X19.0
G0 X19.0 Y0.0
G0 Z0.0
G1 Z-10.0 F600.0
G4 P1.0

G0 Z5.0
M5
M30

++
David
« Last Edit: October 16, 2019, 00:04:24 am by dh42 »

Offline OTJtraining...Again

  • Ewok
  • *
  • Posts: 21
    • View Profile
Re: GRBL post processor
« Reply #11 on: February 25, 2020, 23:59:36 pm »
GRBL has certainly become popular in recent years.

I haven't yet tested this post processor on a GRBL, but if anyone would like to test and make suggestions for improvements, I would be very grateful.

The main change to this post from the default post processor is the replacement of drilling canned cycles with G0/G1 moves.

The 'Drill' post processor property is:
Code: [Select]
{$g0} {$_x} {$_y}
{$g0} Z{$mop.retractheight}
{$g1} {$_z} {$_f}
{$g0} Z{$mop.clearanceplane}

and 'Drill Dwell' is:
Code: [Select]
{$g0} {$_x} {$_y}
{$g0} Z{$mop.retractheight}
{$g1} {$_z} {$_f}
G4 {$p}
{$g0} Z{$mop.clearanceplane}

Peck drilling is currently not supported as this would require the post processor definitions to be able to handle more complex loops or scripts.
A post build command could be created to handle this.

I hope this post is useful starting point.


Responding to the OP, I found that I needed to add a Z to the example code provided on the third line:

{$g0} {$_x} {$_y}
{$g0} Z{$mop.retractheight}
{$g1} Z{$_z} {$_f}
{$g0} Z{$mop.clearanceplane}

Seems like it shouldn't be necessary, but if I don't add it there is no Z in my final code. If it's a user error on my part maybe someone can enlighten me.

From the 'About' screen:
CamBam plus [0.9] Rel 8P
Copyright © 2015 HexRay Ltd

CamBam.CAD : 0.9.5729.19316
CamBam : 0.9.5729.19317
Build Date : 9/8/2015 11:43:52 AM
Framework Version : 2.0.50727.9148

Offline onekk

  • CNC Jedi
  • *****
  • Posts: 504
    • View Profile
Re: GRBL post processor
« Reply #12 on: February 26, 2020, 10:34:53 am »
GRBL don't do drill with canned cycle, I use it on my CNC machine, (almost daily when it is not cold :-D) and I have resolved to use spiral drill strategy.

There are some "senders" that support a form of "canned cycle" reinterpreting the code prior to send it to GRBL, and these seems to use a standard way to intepreter at least G81 and G62 if I remeber well.

Regards

Carlo D.
Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam

Offline OTJtraining...Again

  • Ewok
  • *
  • Posts: 21
    • View Profile
Re: GRBL post processor
« Reply #13 on: March 02, 2020, 19:45:37 pm »
This might be a little off topic, but it's very related to setting up a 'successful' GRBL post processor on the 3018-Pro.

One more thing I've painfully learned with GRBL. In my case it's on the 3018-Pro Genmitsu CNCs. We run two now to offload tiny parts and reduce setups on a large router.

If I leave too many comment lines at the top something goes haywire and things take off in crazy directions. What's worse is that the behavior is not uniform. One time it seems right, just out of place, the next time the spindle is diving into the bed. A third attempt is completely different from the first two, still very wrong.

With some experimentation I think that it might be related to the  Tooling commands on the third line, but I've generally just started stripping all of the comments which help CutViewer set up correctly.
Code: [Select]
( Made using CamBam - http://www.cambam.co.uk )
( v8.0_drain_plug_3018_v2 2/28/2020 6:34:17 PM )
(  T101 : 3.175 )
( CUTVIEWER )
( FROM/0,0,5 )
( Select dummy tool to avoid warnings )
( TOOL/MILL, 3.175, 1.5875, 40.0, 0 )
( STOCK/BLOCK,200.0,115.0,19.05,0.0,115.0,19.05 )
So if I remove all of the comments at the top (example above), the code generally runs fine.

It would be nice to not have to do that, but it's manageable. At least Mach3 doesn't hiccup on it. A hiccup on a tiny machine is manageable, on a large machine it could make for a real mess.

One more adjustment which I put in place before what I've written above, I've also found that some hiccups can occur later in a run when there are lots of arc commands. I've taken to using 'Arc Output' set to 'Convert to Lines'. There are hundreds of thousands more lines of Gcode, but I get good parts instead of broken tools and messes to clean up!

It's possible that the source of the trouble is not the interpreter making a mistake, but rather noise on the serial lines between the controller device and the interpreter. I use the standalone controller, and the stepper motors are a great noise source. I'm not sold on this explanation, but I did track some of my early trouble to a place where a '-' sign was dropped between the controller and interpreter.

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 2875
    • View Profile
Re: GRBL post processor
« Reply #14 on: March 02, 2020, 21:02:10 pm »
If you are using USB cable make sure it is shielded. I have read cheap usb cables are source of problems.
My 2¢

Win 10 64 bit, CB [1.0} rc 1 64 bit, Mach3, ESS, G540