# I need help for (similar like laser) spindle on / off via relay

**URL:** <https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173>\
**Category:** X-Carve\
**Created:** [July 27, 2017, 12:22pm UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173 "2017-07-27T12:22:41Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![UbaidAli](https://avatars.discourse-cdn.com/v4/letter/u/a88e57/32.png) [@UbaidAli](https://community.inventables.com/u/UbaidAli)\
**Post date:** [July 27, 2017, 12:22pm UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/1 "2017-07-27T12:22:42Z")

</div>

Hi, I have x carve I want to know how to used spindle signal something different now it will **ON** when job start and **OFF** after job completed that is fine for cnc work. I want spindle signal via relay should be on when goes down for cut and Immediately off when lift up.  
anything changes in gcode while toolpath creating can possible thanks for your kind help.

---

<div class="post-metadata">

**Author:** ![UbaidAli](https://avatars.discourse-cdn.com/v4/letter/u/a88e57/32.png) [@UbaidAli](https://community.inventables.com/u/UbaidAli)\
**Post date:** [July 27, 2017, 1:05pm UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/3 "2017-07-27T13:05:21Z")

</div>

I need to edit gcode in text editor I get that and where should I add .

G0 Z0.2000 (seen many times in my gcode file)

In Gcode wherever I seen G0 **Z0**. I need to add M3S1200 before and M5 afterwards thats it.  
Thanks for explain.

---

<div class="post-metadata">

**Author:** ![AaronMatthews](https://yyz1.discourse-cdn.com/flex009/user_avatar/community.inventables.com/aaronmatthews/32/73728_2.png) [@AaronMatthews](https://community.inventables.com/u/AaronMatthews)\
**Post date:** [July 27, 2017, 7:49pm UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/5 "2017-07-27T19:49:29Z")

</div>

You can add in the commands manualy. 😕 Tricky to have it do automatically as I am not sure how “smart” most post processors are.

You may want to take a look at how the “laser mode” works in the newer grbl’s 1.0c and 1.1  
I know it somehow changes how the spindle commands are sent so the laser will start / stop right away.

---

<div class="post-metadata">

**Author:** ![UbaidAli](https://avatars.discourse-cdn.com/v4/letter/u/a88e57/32.png) [@UbaidAli](https://community.inventables.com/u/UbaidAli)\
**Post date:** [July 28, 2017, 9:49am UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/6 "2017-07-28T09:49:56Z")

</div>

I did try this jtech post processor it does not work for me because maybe I have grbl v0.9g  
if you have someone 1.0c could you please try see if there is spindle on/off while cutting.

> **[Vectric Laser Post Processor | J Tech Photonics, Inc.](https://jtechphotonics.com/?p=3851)**
>
> To get assistance with your vectric laser post processor, visit J Tech Photonics, Inc. We offer step-by-step help in order to run your machine safely.

I already try **GRBL – No Z Version** and GRBL inch version everything goes well but cannot on/off spindle.

Thanks for your time and help

---

<div class="post-metadata">

**Author:** ![UbaidAli](https://avatars.discourse-cdn.com/v4/letter/u/a88e57/32.png) [@UbaidAli](https://community.inventables.com/u/UbaidAli)\
**Post date:** [July 31, 2017, 11:07am UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/7 "2017-07-31T11:07:07Z")

</div>

Hi, any guys could you please help try this post processor if you have GRBL 1.0c

I want to know spindle should be start/stop while cutting. when goes down START when lifting up STOP

[J\_Tech\_GRBL\_Inch\_NoZ\_v1\_5.pp](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex009/uploads/inventables/original/3X/5/5/551dd3df5fb67675191d156081f3b00164ce7111.pp) (4.5 KB)

---

<div class="post-metadata">

**Author:** ![LarryM](https://yyz1.discourse-cdn.com/flex009/user_avatar/community.inventables.com/larrym/32/51450_2.png) [@LarryM](https://community.inventables.com/u/LarryM)\
**Post date:** [July 31, 2017, 11:35am UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/8 "2017-07-31T11:35:58Z")

</div>

> [@UbaidAli](#):
>
> try this post processor if you have GRBL 1.0c

No need to try it, this post processor does not have any Z movements in it. Your Z will not go down or lift up.

---

<div class="post-metadata">

**Author:** ![UbaidAli](https://avatars.discourse-cdn.com/v4/letter/u/a88e57/32.png) [@UbaidAli](https://community.inventables.com/u/UbaidAli)\
**Post date:** [July 31, 2017, 11:42am UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/9 "2017-07-31T11:42:20Z")

</div>

Thanks for reply  
Yes, I don’t want use z axis because I want put (plasma) torch is at a fixed height.  
I have another pp with Z also I try both not working what I want like.[J\_Tech\_GRBL\_inch\_v1\_2.pp](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex009/uploads/inventables/original/3X/a/f/af97f282ce7a59e395aa30c02183beebc43eb7a1.pp) (4.5 KB)

---

<div class="post-metadata">

**Author:** ![UbaidAli](https://avatars.discourse-cdn.com/v4/letter/u/a88e57/32.png) [@UbaidAli](https://community.inventables.com/u/UbaidAli)\
**Post date:** [July 31, 2017, 11:47am UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/10 "2017-07-31T11:47:18Z")

</div>

@LarryM Kindly read this I am not getting how to do it. (I read this in other forum)

Hi, I am using this post processor to generate gcode for a plasma cutter, everything is working fine except i need some dwell times for torch on and torch off, in the gcode. Right now i am generating gcode and than editing the gcode manually. Can i edit the post processor to get it to create dwell or do i have to use mach3 to create dwell time. I am using spindle output 1 pin 17 with a relay to turn the torch on and off. I don’t have a z axis, the torch is at a fixed height.  
Thanks,  
LeRoy Mader

REPLY

jtechphotonicscom  
Hi Leroy- You can put in a G4 P# command (where # is the time in seconds you want to dwell). Just edit the post processor in a text editor. When there is a M3 command, then put a G4 P# command on the next line. Also, put a G4 P# in the “retract” section after the M05 command. This will generate the g code file you are looking for.

---

<div class="post-metadata">

**Author:** ![LarryM](https://yyz1.discourse-cdn.com/flex009/user_avatar/community.inventables.com/larrym/32/51450_2.png) [@LarryM](https://community.inventables.com/u/LarryM)\
**Post date:** [July 31, 2017, 6:50pm UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/11 "2017-07-31T18:50:58Z")

</div>

There is not enough information here to determine what your situation is.

What CAM program are you using to generate the G-code?  
What electronic controller are you using to run your machine?  
How do you have your relay wired to the electronic controller?

What is the specific problem that you have with your machine that doesn’t work the way you want it to, and how do you want it to work.

The more information you can provide makes it easier to see if a solution is available for your setup.

---

<div class="post-metadata">

**Author:** ![UbaidAli](https://avatars.discourse-cdn.com/v4/letter/u/a88e57/32.png) [@UbaidAli](https://community.inventables.com/u/UbaidAli)\
**Post date:** [July 31, 2017, 10:02pm UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/12 "2017-07-31T22:02:15Z")

</div>

I am using vcarve pro for cam. and save gcode with above pp. and run job with UGCS  
I have adruino cnc shield gshield 1000mm xcarve  
with grbl v0.9g install firmware  
I did wire pwm signal to relay and makita spindle with automatic start.  
I want gcode should be run like laser cut if the spindle plunge for cut START and when lift up OFF  
while moving in air spindle should be OFF only should be ON while plunge for cuts.

I want use this setup for plasma when I get to know how gcode works I will remove spindle and mount a pilot arc plasma torch on z axis for this I did edit the above post processor wherever m03 added m05 command before line but spindle runs continous till the job ends.

Thanks for help and reply

---

<div class="post-metadata">

**Author:** ![UbaidAli](https://avatars.discourse-cdn.com/v4/letter/u/a88e57/32.png) [@UbaidAli](https://community.inventables.com/u/UbaidAli)\
**Post date:** [July 31, 2017, 10:18pm UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/13 "2017-07-31T22:18:15Z")

</div>

I want use with z axis gcode above I attach PP fille because in this i can easy edit manually wherever seen Z0 in gocde I think put M03 and M05 with windows editor.  
Now I want the post processor should do automatic.  
my english is bit limit sorry for any grammer mistakes here .

---

<div class="post-metadata">

**Author:** ![LarryM](https://yyz1.discourse-cdn.com/flex009/user_avatar/community.inventables.com/larrym/32/51450_2.png) [@LarryM](https://community.inventables.com/u/LarryM)\
**Post date:** [July 31, 2017, 10:38pm UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/14 "2017-07-31T22:38:19Z")

</div>

> [@UbaidAli](#):
>
> I want gcode should be run like laser cut if the spindle plunge for cut START and when lift up OFFwhile moving in air spindle should be OFF only should be ON while plunge for cuts.

Just so I understand better.

You want the plasma cutter to turn on when you plunge, then you will make XY moves to make the cut, and then when the plasma cutter is lifted you want it to turn off. Next plunge turns it back on, makes more XY moves, turns off when it lifts. Repeat until end of file.

Correct?

---

<div class="post-metadata">

**Author:** ![LarryM](https://yyz1.discourse-cdn.com/flex009/user_avatar/community.inventables.com/larrym/32/51450_2.png) [@LarryM](https://community.inventables.com/u/LarryM)\
**Post date:** [August 1, 2017, 4:15am UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/15 "2017-08-01T04:15:50Z")

</div>

Ok. Try this.

Update your Arduino with this [version of grbl](https://community.inventables.com/t/xcarve-jtech-grbl-update-11-12-2016/28943)

Set $30=1.0 and $31=0.0

Use this post processor with Vcarve:  
[UbaidAli\_inch.pp](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex009/uploads/inventables/original/3X/3/c/3ca5ed0e7b9893d0d61d46bf3f083c39feb2d0ef.pp) (4.3 KB)

---

<div class="post-metadata">

**Author:** ![UbaidAli](https://avatars.discourse-cdn.com/v4/letter/u/a88e57/32.png) [@UbaidAli](https://community.inventables.com/u/UbaidAli)\
**Post date:** [August 1, 2017, 10:35am UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/16 "2017-08-01T10:35:13Z")

</div>

@LarryM Now I am sure I get what I need here . Thank you very much for help I appreciate your time and many replies Now I can use all my existing machine and electronics. Thanks for Post processor the main application without this its not possible. when I update with newest grbl I will try it.

when I get first reply from yours I was think now its possible.  
Thanks again. I hope you have great day.

---

<div class="post-metadata">

**Author:** ![UbaidAli](https://avatars.discourse-cdn.com/v4/letter/u/a88e57/32.png) [@UbaidAli](https://community.inventables.com/u/UbaidAli)\
**Post date:** [August 1, 2017, 12:41pm UTC](https://community.inventables.com/t/i-need-help-for-similar-like-laser-spindle-on-off-via-relay/40173/17 "2017-08-01T12:41:56Z")

</div>

Now I try and Tested works great. I try few runs with spindle.

No need to editing manually all gcode works automatic. Thanks again.
