Hello Guest it is December 26, 2024, 07:56:14 AM

Author Topic: machine goes to wrong coordinates after Mach 3 tool change script  (Read 4679 times)

0 Members and 1 Guest are viewing this topic.

Perhaps someone can look at a snippet of code and tell me if it explains why Mach3 goes crazy after it stops for a (manual) tool change). Mach 3 is configured as "stop spindle, wait for cycle start". 
When I first  start the job, the tool change light  flashes and waits for a second "cycle" press. I press, and the machine starts to work normally.
When it reaches the end of the code, it stops and asks for tool change( T2). After changing the tool, when I press cycle, instead of going to the correct coordinates to start cutting, the machine runs away until it hits the safety switch at the end of the axis.

At this point, in order to continue, I need to send it zero, and do " a run from here" operation. In this case, the machine works normally.

I am stumbled. The only change I've made is that I have a new PC and installed a new version of Mach3. The first pc would always crash if I used the "stop spindle, wait for cycle start" option. So I always ran it with the "ignore tool change" option. I never liked this option, since I would, from time to time, forget to change the tool number in Mach3.

The mach3 script is unchanged, and I imported the Mach 3 configuration from the old pc.

I'd like someone to look at the code and perhaps shed some light on the issue.
thanks
tony

Here's a snippet of the code as generated by my CAM program.

N13250 G1 Y7.5758
N13260 G3 X10.33 Y7.6383 I-.0625 J0.
N13270 G1 X9.85
N13280 G3 X9.7875 Y7.5758 I0. J-.0625
N13290 G0 Z.275
N13300 M5
N13310 G91 G28 Z0.
N13320 M01
( POCKET SIDES )
N13330 T2 M6
N13340 G0 G90 G54 X3.3147 Y3.219 S4278 M3
N13350 G43 H2 Z.25
N13360 Z.2
N13370 G1 Z-.07 F26.16
N13380 Y5.5315 F66.16
« Last Edit: November 23, 2016, 10:11:24 AM by greenene »

Offline Davek0974

*
  •  2,606 2,606
Re: machine goes to wrong coordinates after Mach 3 tool change script
« Reply #1 on: November 23, 2016, 10:33:08 AM »
Have you got some code in your M6start or more importantly M6End macros?

Re: machine goes to wrong coordinates after Mach 3 tool change script
« Reply #2 on: November 23, 2016, 11:19:05 AM »
As I stated, I did not look or touch the code in the M6Start or M6end. Am I supposed to make changes to the default settings that Mach3 install comes with?
tony

Offline Davek0974

*
  •  2,606 2,606
Re: machine goes to wrong coordinates after Mach 3 tool change script
« Reply #3 on: November 23, 2016, 12:46:44 PM »
Sometimes they need tweaking, but the defaults should be safe and should not issue any move commands.

I can't see anything in that code - after the tool change it should go to X3.3147 Y3.219 - wherever that is, is your machine homed before use?

Something has to be telling it to run off in an odd direction, I have not known Mach to do this on its own. The main culprit would be the M6end macro in my mind.

I also use the stop and wait type of tool-change and it does work ok, what version of Mach3 are you running? I think 062 is rated as the most stable?

Offline Davek0974

*
  •  2,606 2,606
Re: machine goes to wrong coordinates after Mach 3 tool change script
« Reply #4 on: November 23, 2016, 03:33:03 PM »
Just had a very good friend let me know something I hadn't spotted....

This part...

( POCKET SIDES )
N13330 T2 M6
N13340 G0 G90 G54 X3.3147 Y3.219 S4278 M3
N13350 G43 H2 Z.25

Line N13340 is a bit of a mess and could be the culprit it seems, at least to Mach3.

G0 is a rapid move, G90 is absolute distance mode, G54 selects fixture offset 1, then we move to a coordinate X & Y, set the spindle speed and turn on the spindle all in one block.

Do we know what offset we were in at the start - was it G54?
Is G54 referenced to machine home?
Was the machine homed at all?

Might be worth trying the code like this...

G90 G54  - set modes fiirst
G00 X3.3147 Y3.219 - carry out positioning moves
M3 S4278 - start spindle and set speed

Try that, it might be the post processor is not the right one, or needs a few tweaks, what program is it generated in?
Re: machine goes to wrong coordinates after Mach 3 tool change script
« Reply #5 on: November 27, 2016, 06:49:38 AM »
I am getting over a cold. I'll be trying the machine today again and report back.
Thanks for the help so far.
tony
Re: machine goes to wrong coordinates after Mach 3 tool change script
« Reply #6 on: November 28, 2016, 11:28:32 AM »
A different post processor apparently fixed the issue. Thanks for the help.
tony