Hello Guest it is May 25, 2019, 09:51:45 PM

Author Topic: Mach3 M6 Tool Change Strange Movement  (Read 1144 times)

0 Members and 1 Guest are viewing this topic.

Mach3 M6 Tool Change Strange Movement
« on: August 11, 2016, 06:16:31 PM »
This is my first post, but I am a long time follower of this forum.

I am running my 4th mach3 machine, second using tool changer.  On my previous machine I tool existing tool change code and customized it myself for my machine. I recently purchased a Roctech (chinese) atc machine with HSD spindle. It is an impressive machine, but requires insane amounts of setup. Most of the circuit boards and software on it were junk, so I upgraded to a ethernet smoothstepper coupled with a PMDX board. So far so good. Computer had strange chinese plugins tied into mach3, so I reinstalled it with a fresh copy and essentially started over.  My z axis is set so machine zero is with spindle at top of the z vertial movement. Work zero is top of the table. So tool offsets are typically larger negative numbers (around -15 to -18")

hopefully you have enough background now. So down to the problem .

occasionally (1 in 50), typically first tool change made during gcode run, the machine will take a very fast negative z direction dive straight for my table. It sort of acts like it doesn't know where it is. The machine is always zeroed properly when this happens. I am attaching my m6start code along with some simple g code where i experienced the problem recently. I have tried everything, I feel like it is most likely just poorly written m6 script or bad post processor settings. I know enough to be dangerous, and I sense that one of you users on here will look at this and know pretty quickly what is wrong.

Offline ger21

*
  • *
  •  6,233 6,233
    • View Profile
    • The CNC Woodworker
Re: Mach3 M6 Tool Change Strange Movement
« Reply #1 on: August 11, 2016, 07:15:35 PM »
First, whatever you're generating your code with, you need a better post for it.
The first line is very wrong.

"G00  g43 G40.1 G17 G80 G50 G90 G90"

G00 without any movement.
G43 shouldn't be called without an H word.
G41.1 is not a valid Mach3 code

Two G90's on the same line.

Are you homing the machine before anything else?
If not, this move can drive down:

Code "G00 G53 Z" & ToolSafe & "F" & spd2

Also note that the feedrate in that line has no effect, as it's a rapid move.

Code like this:

Code "G0 G53 Z" & ZPos & "F" & spd2
Code "G4 P.75"
While IsMoving()
Wend

Should be:

Code "G0 G53 Z" & ZPos
While IsMoving()
Wend
Code "G4 P.75"
While IsMoving()
Wend

I don't see anything that jumps, out, but it is very sloppy code.

Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Mach3 M6 Tool Change Strange Movement
« Reply #2 on: August 12, 2016, 09:28:45 AM »
Thanks Gerry. I will definitely make those changes, I think some of those strange updates happened in my desperate attempts to solve the issue.

yes, we do home the machine every morning first thing. Every time that problem came up, I definitely checked to see if it was homed, and it was.

Speaking of homing, I have been meaning to write some script into my M6start that prevents a tool change unless machine is homed, any ideas on that? would definitely be a smart way to prevent user errors.