Page 2 of 2

Re: how to modify GRBL for Z axis to tool ON OFF

Posted: Wed Oct 10, 2012 3:21 am
by daveczrn
Check out buildlog.net. there are plenty of guys using mach3 over there to laser engrave with.

Re: how to modify GRBL for Z axis to tool ON OFF

Posted: Wed Oct 10, 2012 11:09 am
by LineKernel
thanks Fibo
i was more asking how to do it , in software side , like in pycam
so i wont have to modify grbl , or wont have to use 2 arduino

also i should have wrote that i am running under windows

i think i ll make a post in the software side of the forum , also i am following "someguy" that is trying to do the same kind of thing with a plasma cutter

Re: how to modify GRBL for Z axis to tool ON OFF

Posted: Wed Oct 10, 2012 11:23 am
by LineKernel
@jhllt67
thanks i will take a look at Cambam , the only thing is , i dont really understand so much about the gcode header , i only tried pycam with gcode sender
and there is too much things in the header for me to understand it all for now ...
but i ll take a look
thanks

@daveczrn
yes thanks , but i will try to use non commercial software


i start thinking , it could be not that difficult to do a "replace" on the .txt (understand gcode) file
what would you guys use for doing an automatic "replace" ?
also if i find a way to do it in pycam , i ll post !

Cheers

Re: how to modify GRBL for Z axis to tool ON OFF

Posted: Wed Oct 10, 2012 5:10 pm
by fito
I've been using heekscnc and it uses post-processors to output gcode specific to different machines. Creating a new post processor from the emc2 post processor with the refenrences to z-axis move replaced by tool on or tool off shouldn't be terribly hard- I type this with no python experience.

If you wanted to edit the the generated gcode file it should be easy to replace the instances of z-axis with the appropriate tool on/off command. If there are alot of z moves you may want to use a script to do the replacement.

Re: how to modify GRBL for Z axis to tool ON OFF

Posted: Fri May 03, 2013 5:02 pm
by Nero
Hi,

Sorry for my bad english i try my best and hope you guys understand me.

Ok this Topic is old but i had the same problem as LineKernel and it is now working fine.
So is thought i post the changes i made in the gcode.c so others can use it.

It is just a minor change nothing big and it only does turn on/off pin12 wen z >/<= 0.

First at line 178 change

Code: Select all

          case 3: gc.spindle_direction = 1; break;
          case 4: gc.spindle_direction = -1; break;
          case 5: gc.spindle_direction = 0; break;
to

Code: Select all

          case 3: gc.spindle_direction = 0; break;
          case 4: gc.spindle_direction = 0; break;
          case 5: gc.spindle_direction = 0; break;
Now it will always be off.

And in line 236 before the

Code: Select all

break;
add this

Code: Select all

      if (value >= 0) gc.spindle_direction = 0;
      if (value < 0)  gc.spindle_direction = 1;
Now you can use pin12 as a on/off switch.

I hope it helps

Re: how to modify GRBL for Z axis to tool ON OFF

Posted: Thu Jun 13, 2013 6:15 pm
by SnapFracturePop
I wrote a script that makes a few modifications for laser-friendliness:
http://qcgeek.com/laseroko/

*turns laser on at every g1/g2/g3
*turns laser off at every g0
*removes all Z movement
*removes all F speed changes

Typically I use Inkscape to draw the shape, the Inkscape GCode plugin to generate the commands (make sure it's only one pass), run the resulting GCode through the Laseroko script, modify the single F command depending on my material, then cut! Or, run through http://qcgeek.com/laseroko/draw.php to preview.