# Raise Z when I stop a job?

**URL:** <https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140>\
**Category:** ❓ Question\
**Created:** [October 27, 2023, 5:17pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140 "2023-10-27T17:17:23Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![timarland](https://forum.sienci.com/letter_avatar_proxy/v4/letter/t/ee59a6/32.png) [@timarland](https://forum.sienci.com/u/timarland)\
**Post date:** [October 27, 2023, 5:17pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/1 "2023-10-27T17:17:23Z")

</div>

I’m sure this is easy and I’m just searching the wrong terms here - but is there a way to automatically move back to safe height when I stop a job?

As it stands, when I hit the stop job button, the spindle stops moving, but it stays in whatever current Z position it was cutting in, which causes obvious problems.

What am I missing?

Thanks!

---

<div class="post-metadata">

**Author:** ![gwilki](https://forum.sienci.com/user_avatar/forum.sienci.com/gwilki/32/366_2.png) [@gwilki](https://forum.sienci.com/u/gwilki)\
**Post date:** [October 27, 2023, 6:11pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/2 "2023-10-27T18:11:13Z")

</div>

@timarland I can’t answer your question, but I’ll ask a couple of questions to help those who would like to help you.

Are you stopping the job by clicking on the GUI stop button?

When I use that button, it’s because something is not right. Is that why you are stopping it?

What are the “obvious problems” that the current process is causing?

---

<div class="post-metadata">

**Author:** ![timarland](https://forum.sienci.com/letter_avatar_proxy/v4/letter/t/ee59a6/32.png) [@timarland](https://forum.sienci.com/u/timarland)\
**Post date:** [October 27, 2023, 7:48pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/3 "2023-10-27T19:48:03Z")

</div>

Thanks @gwilki!

Yes - stopping by clicking on the GUI stop button.

Yes - always because something is wrong. In my case, as I do a lot of board flattening it’s usually something where the piece wasn’t as even as I thought or I messed up z zero to begin with and the job is cutting too high or too deep.

In the case of cutting too deep, obviously that’s where the need/desire for the stop job to automatically jog the z back to the default safe height as until I can get my fat fingers over to the router and turn it off the bit is turning and burning or chipping in my work piece.

Part of what (I assume) is one of the gsender settings is after doing a z probe, z is jogged back to .740 - doing that when I stop a job would be ideal.

---

<div class="post-metadata">

**Author:** ![gwilki](https://forum.sienci.com/user_avatar/forum.sienci.com/gwilki/32/366_2.png) [@gwilki](https://forum.sienci.com/u/gwilki)\
**Post date:** [October 27, 2023, 8:32pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/4 "2023-10-27T20:32:38Z")

</div>

@timarland Tks much. I understand now what you are trying to do. Sienci techs monitor the gSender topic quite closely, so I’m confident that they will see this. I have no clue has to what it would entail to change gS to do this. They need to consider any unintended consequences for other users, too.

FWIW, I have my router and the LM controller on a power bar controlled by a paddle switch. When the stuff really hits the fan, I slap the paddle switch and everything dies. Of course, that also means that I’ve lost my zeroes, so I try not to do this often. 😀

If you are using any kind of controller and short cut keys, you could always link a shortcut key to a macro that stops carving and raises the router. Just a thought.

---

<div class="post-metadata">

**Author:** ![\_Michael](https://forum.sienci.com/user_avatar/forum.sienci.com/_michael/32/2962_2.png) [@\_Michael](https://forum.sienci.com/u/_Michael)\
**Post date:** [October 27, 2023, 8:36pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/5 "2023-10-27T20:36:08Z")

</div>

I don’t know of a way to make gSender raise the bit automatically but I do know a way for the router to turn off automatically. I have the IOT relay that Sienci describes.

> **[Automated / IOT Relay - LongMill MK2 CNC](https://resources.sienci.com/view/lmk2-automated-relay/)**
>
> Use an IOT relay on your LongMill CNC to automatically control power to your router, vacuum, lighting, or other AC power systems.

I bought mine from [here](https://dlidirect.com/products/iot-power-relay) and I love it. It turns on my vacuum and router when using the router. I unplug those and plug in my air assist and exhaust when using my laser. Then I modified the post processor in Vectric to send M8 to turn on the relay on job start and M9 to turn off at job end.

Bear in mind that it only works to turn off the router when hitting the gSender stop button but not the physical stop button.

---

<div class="post-metadata">

**Author:** ![gwilki](https://forum.sienci.com/user_avatar/forum.sienci.com/gwilki/32/366_2.png) [@gwilki](https://forum.sienci.com/u/gwilki)\
**Post date:** [October 27, 2023, 8:47pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/6 "2023-10-27T20:47:51Z")

</div>

@_Michael That’s good info, Michael. I’m curious, though. In the situation being discussed, the gcode never gets to the M8 command. However, the relay will still kill the router from the Stop GUI??

---

<div class="post-metadata">

**Author:** ![\_Michael](https://forum.sienci.com/user_avatar/forum.sienci.com/_michael/32/2962_2.png) [@\_Michael](https://forum.sienci.com/u/_Michael)\
**Post date:** [October 27, 2023, 8:57pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/7 "2023-10-27T20:57:07Z")

</div>

I think that gSender must send the M2 command which does the following.

- Change from Auto mode to MDI mode.

- Origin offsets are set to the default (like G54).

- Selected plane is set to XY plane (like G17).

- Distance mode is set to absolute mode (like G90).

- Feed rate mode is set to units per minute (like G94).

- Feed and speed overrides are set to ON (like M48).

- Cutter compensation is turned off (like G40).

- The spindle is stopped (like M5).

- The current motion mode is set to feed (like G1).

- Coolant is turned off (like M9).

Last on the list is turning the coolant off and that kills the router. I just tested it again to make sure my info was good.

---

<div class="post-metadata">

**Author:** ![CrookedWoodTex](https://forum.sienci.com/user_avatar/forum.sienci.com/crookedwoodtex/32/10446_2.png) [@CrookedWoodTex](https://forum.sienci.com/u/CrookedWoodTex)\
**Post date:** [October 27, 2023, 9:16pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/8 "2023-10-27T21:16:11Z")

</div>

I’m away from my machine, but don’t forget about the Start/Stop G-code part of Settings:

> **[Additional Features - gSender Docs](https://resources.sienci.com/view/gs-additional-features/#startstop-g-code)**
>
> Learn the advanced features of gSender such as shortcuts, macros, workspaces, calibration tools, controlling spindles, lasers, coolant, and more.

---

<div class="post-metadata">

**Author:** ![\_Michael](https://forum.sienci.com/user_avatar/forum.sienci.com/_michael/32/2962_2.png) [@\_Michael](https://forum.sienci.com/u/_Michael)\
**Post date:** [October 27, 2023, 9:17pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/9 "2023-10-27T21:17:12Z")

</div>

Yeah, you can do that if you don’t want to change the post processor. Thanks for mentioning that.

---

<div class="post-metadata">

**Author:** ![timarland](https://forum.sienci.com/letter_avatar_proxy/v4/letter/t/ee59a6/32.png) [@timarland](https://forum.sienci.com/u/timarland)\
**Post date:** [October 27, 2023, 10:27pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/10 "2023-10-27T22:27:05Z")

</div>

This is all great info! I’ll check out start/stop gcode - should have figured there’d be something like that.

@_Michael that IOT thing looks pretty rad - might give that a crack too if I can figure out somewhere to connect it on the xcarve controller.

Thanks!

---

<div class="post-metadata">

**Author:** ![CrookedWoodTex](https://forum.sienci.com/user_avatar/forum.sienci.com/crookedwoodtex/32/10446_2.png) [@CrookedWoodTex](https://forum.sienci.com/u/CrookedWoodTex)\
**Post date:** [October 27, 2023, 11:18pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/11 "2023-10-27T23:18:03Z")

</div>

If you’ll study some of my macro code at the following link, you’ll find code for a safe Z move. Perhaps it will work in your case.

```auto
G53 G1 Z-0.8 ; SAFE RETRACT

```

> [@Macros For My Workflow UPDATED: 2023-10-27](https://forum.sienci.com/t/macros-for-my-workflow-updated-2023-10-27/9648):
>
> Something that you should understand. What I’ve done here is done for my workflow and my machine. If you attempt to use what I provide here, you must be responsible for making adjustments that work for your machine. The best place to start is at the beginning, and I hope you don’t mind how verbose this story is. smiley I found myself going through this repeating dance between putting in a bit, moving to the zero block, moving off-table to adjust my zero for the thickness of tape & CA glue ho…

---

<div class="post-metadata">

**Author:** ![\_Michael](https://forum.sienci.com/user_avatar/forum.sienci.com/_michael/32/2962_2.png) [@\_Michael](https://forum.sienci.com/u/_Michael)\
**Post date:** [October 27, 2023, 11:18pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/12 "2023-10-27T23:18:19Z")

</div>

![Screenshot 2023-10-27 191657](https://forum.sienci.com/uploads/default/original/2X/7/72fe8285015e47d33e33046ba9da4f876bc310bb.jpeg)  
If this is the controller you have then you would hook up the IOT to where it says M8 (FLOOD) and GRND.

---

<div class="post-metadata">

**Author:** ![Parkey](https://forum.sienci.com/user_avatar/forum.sienci.com/parkey/32/5310_2.png) [@Parkey](https://forum.sienci.com/u/Parkey)\
**Post date:** [October 31, 2023, 9:05pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/13 "2023-10-31T21:05:54Z")

</div>

@timarland,

I use the IOT on my Longmill and the M8/M9 commands in gSender. If I hit “stop job”, in gSender, my router turns off, but does not go to safe height. Clearly we have the same issue.

Thank you for posting this question. I’ve been pondering this issue for a while now with no success, due to a lack of effort.

I strongly recommend the IOT though. You won’t regret it. If nothing else, it will reduce the amount of burning and on occasion has saved my piece from unreliable damage.

In addition you can’t beat the convenience of not having to manually control your router and vacuum power.

---

<div class="post-metadata">

**Author:** ![\_Michael](https://forum.sienci.com/user_avatar/forum.sienci.com/_michael/32/2962_2.png) [@\_Michael](https://forum.sienci.com/u/_Michael)\
**Post date:** [November 1, 2023, 2:20am UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/14 "2023-11-01T02:20:05Z")

</div>

Just answered another question about controlling a router with the IOT relay and I think now that gSender is the best place to turn the coolant and hence the router on and off because they added On Pause and On Resume which I can’t do from my post processor.

---

<div class="post-metadata">

**Author:** ![chrismakesstuff](https://forum.sienci.com/user_avatar/forum.sienci.com/chrismakesstuff/32/10759_2.png) [@chrismakesstuff](https://forum.sienci.com/u/chrismakesstuff)\
**Post date:** [August 14, 2024, 6:32pm UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/15 "2024-08-14T18:32:54Z")

</div>

Closed on August 14, 2024, 6:32pm UTC



---

<div class="post-metadata">

**Author:** ![chrismakesstuff](https://forum.sienci.com/user_avatar/forum.sienci.com/chrismakesstuff/32/10759_2.png) [@chrismakesstuff](https://forum.sienci.com/u/chrismakesstuff)\
**Post date:** [August 15, 2024, 11:46am UTC](https://forum.sienci.com/t/raise-z-when-i-stop-a-job/10140/16 "2024-08-15T11:46:16Z")

</div>

In case anyone is interested, or for future reference, I added some new documentation to our resources that discusses all of this now. If you have any comments or suggestions for the future please feel free to let me know:

> **[Additional Features - gSender Docs](https://resources.sienci.com/view/gs-additional-features/#startstop-g-code)**
>
> Learn the advanced features of gSender such as shortcuts, macros, workspaces, calibration tools, controlling spindles, lasers, coolant, and more.
