# Tool Change Produces Random movement once program is resumed

**URL:** <https://forum.avidcnc.com/t/tool-change-produces-random-movement-once-program-is-resumed/3121>\
**Category:** General Chat\
**Created:** [April 8, 2024, 3:31am UTC](https://forum.avidcnc.com/t/tool-change-produces-random-movement-once-program-is-resumed/3121 "2024-04-08T03:31:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SkyScraperGuitars](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.avidcnc.com/skyscraperguitars/32/3492_2.png) [@SkyScraperGuitars](https://forum.avidcnc.com/u/SkyScraperGuitars)\
**Post date:** [April 8, 2024, 3:31am UTC](https://forum.avidcnc.com/t/tool-change-produces-random-movement-once-program-is-resumed/3121/1 "2024-04-08T03:31:09Z")

</div>

I’ve got an odd one that I can’t sort out. I’m having trouble resuming my program after a tool change.

I am using Fusion 360 to generate g-code. Here is a reference of what Fusion kicks out for a tool change:

(BORE1 4)  
M5  
M1  
T2 M6  
S18000 M3  
G54  
M8  
G0 X6.0585 Y2.8643  
G43 Z0.6 H2

I used the Tool Change tab to change the current tool number, then I use the Auto Z Height to measure the tool length, then I use the “Resume G-Code” button in the tool change tab to resume the program…

About 1 out of 10 tool changes results in the machine moving way right on the x axis or moving a large distance in the Y+ direction before resuming the program. This usually results in the soft limits or hard limits being tripped and the program comes to a stop. The odd thing is that the machine coordinates read out correctly. It’s not losing its work offsets.

I’m trying to sort out if this is an avid issues (screen set) or if this is a mach 4 issue. I’ve ruined a number of pieces lately because I have a lot of tool changes.

I upgraded to the newest version of Mach4 with no improvement… In fact, it actually caused the spindle to not restart after a good tool change! I need to sort that out too, but I’ll cover that ground later.

Any help would be much appreciated!

Thanks,  
Greg

---

<div class="post-metadata">

**Author:** ![Stephen](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.avidcnc.com/stephen/32/2569_2.png) [@Stephen](https://forum.avidcnc.com/u/Stephen)\
**Post date:** [April 9, 2024, 3:40pm UTC](https://forum.avidcnc.com/t/tool-change-produces-random-movement-once-program-is-resumed/3121/2 "2024-04-09T15:40:16Z")

</div>

Hi Greg, welcome to the forum.

> [@SkyScraperGuitars](#):
>
> the “Resume G-Code” button

You can use the Cycle Start G-code button instead. The “Resume G-Code” button has some extra options and will execute “safe” moves if selected. No idea if this is causing your problem, but if my spindle is already in a safe position, I don’t use the “Resume G-Code” button.

The only other thing I can think of right now is if you’re accidentally switching work offsets.

Because a lot of G-code commands are modal, it might help us if you post more of your program. Maybe a whole program with most of the cut commands snipped out.

---

<div class="post-metadata">

**Author:** ![corbin](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.avidcnc.com/corbin/32/2800_2.png) [@corbin](https://forum.avidcnc.com/u/corbin)\
**Post date:** [April 9, 2024, 5:56pm UTC](https://forum.avidcnc.com/t/tool-change-produces-random-movement-once-program-is-resumed/3121/3 "2024-04-09T17:56:38Z")

</div>

I second what @Stephen said. For the spindle not starting, it is probably one of the macros. From my notes:  
**Profiles/AvidCNC/Macros**

- **IMPORTANT:** Delete all the corresponding \ ***.mcc** files in your Macros folder. These are the compiled files. Deleting them will force Mach 4 to recompile them from the \*.mcs files. You **must do this** to get Mach to use the new macros. You only have to delete the .mcc files for the corresponding .mcs files listed above.

If you still have issues, examine the m3 macro.

---

<div class="post-metadata">

**Author:** ![SkyScraperGuitars](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.avidcnc.com/skyscraperguitars/32/3492_2.png) [@SkyScraperGuitars](https://forum.avidcnc.com/u/SkyScraperGuitars)\
**Post date:** [April 10, 2024, 3:20am UTC](https://forum.avidcnc.com/t/tool-change-produces-random-movement-once-program-is-resumed/3121/4 "2024-04-10T03:20:50Z")

</div>

Stephen and Corbin -

THANK YOU for taking the time to respond. I will give both items a try and post the results in case someone else encounters the same issue.

Regards,  
Greg

---

<div class="post-metadata">

**Author:** ![SkyScraperGuitars](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.avidcnc.com/skyscraperguitars/32/3492_2.png) [@SkyScraperGuitars](https://forum.avidcnc.com/u/SkyScraperGuitars)\
**Post date:** [April 10, 2024, 3:27am UTC](https://forum.avidcnc.com/t/tool-change-produces-random-movement-once-program-is-resumed/3121/5 "2024-04-10T03:27:16Z")

</div>

Corbin-

I see an m30 macro, but not an m3… I may be missing something. I’ll take a peek at the Avid installer again and see if something was accidentally erased.

Greg

---

<div class="post-metadata">

**Author:** ![SkyScraperGuitars](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.avidcnc.com/skyscraperguitars/32/3492_2.png) [@SkyScraperGuitars](https://forum.avidcnc.com/u/SkyScraperGuitars)\
**Post date:** [April 13, 2024, 3:39am UTC](https://forum.avidcnc.com/t/tool-change-produces-random-movement-once-program-is-resumed/3121/6 "2024-04-13T03:39:15Z")

</div>

I got the issue sorted… I updated the software, cleared out macros, etc and was still having this issue. I figured it was either the “Auto-Z” operation or something in the tool change. I noticed the soft limits were turned off every time it “crashed”. I also noticed the soft limits get turned off when the Auto-Z routine starts, then the soft limits get turned back on when the routine finishes… I was unknowingly closing the Auto-Z window before the routine completed all the functions and that was causing the machine to have the issue.

Man, it feels good to have this in the rear view. Now I want to sort out how I can edit some of the buttons to include multiple commands… For example, I’d like to have the Auto-Z function open after the “Move to MTC Location” button is hit. There are a few little things like this that would save a little time during every tool change. Is this something I need to do in LUA or is it something you can edit in the Screen Editor? Hopefully I just need a small push in the right direction.

Thanks again for the help and suggestions.

Greg
