Hello Guest it is March 29, 2024, 04:16:22 AM

Author Topic: Z axis craziness at program start  (Read 4787 times)

0 Members and 1 Guest are viewing this topic.

Z axis craziness at program start
« on: November 08, 2017, 02:02:09 PM »
I'm new to Mach3, and the search engine is failing me - apologies if this has been asked before. (If so, links are appreciated!)

Homebrew CNC with a C10 parallel breakout board, Win7, using fusion 360 for CAD/CAM.

When I load a g-code program, and look at the tool path limits, the upper Z limit seems to be randomly chosen by Mach3. For instance, when cutting a 3D contour from 3/4" stock, Mach3 initially tries to move the Z to +9 inches (this number changes from program to program). Note that my Z has an 8" travel, and a bad limit switch - disconnected at the moment - so I have to stop the program, jog Z, run the program, stop the program, send it back to the correct zero, and continue the program. This is entertaining on some levels, but frustrating.

The piece I'm talking about in this example scenario is less than 3/4" tall (height of the stock). Once I get past the initial step where Mach3 wants to move the carriage off of the top of the rails, it works relatively well.

I don't understand why it's trying to move the carriage all the way up by some weird value before going down again to start the cut.

This occasionally happens with X/Y as well. After cutting the part - in this case, about 12" x 3" - it wants to go to a point 4' away from the origin (which is in the center of the part I'm cutting). My machine isn't that big, so I have to make sure I'm near the stop button when the cut is done. There is no work to do at that location - it just likes to go there. Note that I zero all axes before starting the job, XY in the center of the stock and Z at the top of the stock.

So: WTF?
Re: Z axis craziness at program start
« Reply #1 on: November 08, 2017, 02:56:50 PM »
Hi,
I don't know whats causing the fault but you should have a CNC viewer program which allows you to apply
the Gcode you want to use and see the toolpath prior to commiting it to your machine.

I use a free one NCviewer but there are plenty of them out there. Another one I have used from time to time
is Camotics.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Z axis craziness at program start
« Reply #2 on: November 08, 2017, 03:08:50 PM »
Hi,
I presume also that you have no home switches or you are not homing your machine prior to use nor do you
have softlimits setup or otherwise the machine would fault out rather than pursue a toolpath that takes it
out of bounds.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Z axis craziness at program start
« Reply #3 on: November 08, 2017, 03:16:28 PM »
Viewing it in the simulator in Fusion does not show any of this. It only happens in Mach3.

And, as I stated, I'm zeroing it to the center of the stock, on the surface, before loading or running anything.

I don't have soft limits configured, and the homing switches are disconnected at the moment. But, cutting a 12x3x0.75 part on a 40x36x8 machine, from stock in the middle of the cutting area, with Mach zeroed to the center of the stock, shouldn't require limit switches. It should never try and move to a point 4' away that's not in the CAD and isn't a home location.

Unless I'm missing something really obvious.

I'll look at the gcode again, I suppose, but it'd surprise me if Fusion was generating this since I've set it to use the model origin, and the simulation doesn't show any of this.
« Last Edit: November 08, 2017, 03:19:28 PM by Techvette »
Re: Z axis craziness at program start
« Reply #4 on: November 08, 2017, 03:58:22 PM »
Hi,
OK so the problem is not Gcode.

When you say that the machine attempts to go out of bounds...how do you know the supposed destination of the faulting axis?
Can you see it in the DRO?

Quote
I don't have soft limits configured, and the homing switches are disconnected at the moment
I think this is a mistake. I operated this way for about a year and suffered quite a few crashes until I fitted
decent home switches. I reduced the number of crashes by over 95%. I now regard good home switches as a must.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Z axis craziness at program start
« Reply #5 on: November 08, 2017, 05:33:49 PM »
I think this is a mistake. I operated this way for about a year and suffered quite a few crashes until I fitted
decent home switches. I reduced the number of crashes by over 95%. I now regard good home switches as a must.

I agree wholeheartedly, but that's a separate issue.

If run the gcode in a different simulator, and I see no out-of-bounds moves. The tool stays in the area I'd expect it to.  

But, when I load it up in Mach3 and look at the tool path tab, I see this:

.


Note the big vertical red line, which is about where the carriage tries to go when I run the program.




Note the "program limits" values, and the nice dotted red line going from the end of the last tool path to a point 54" south and 14" east.

I'm attaching the gcode in case anyone feels like looking at it and pointing out what I'm doing wrong. (SURELY this is my fault, but I'm at a loss as to how / why.)

Thanks for your time.



Re: Z axis craziness at program start
« Reply #6 on: November 08, 2017, 05:56:45 PM »
Hi,
the limits clearly suggest a Gcode fault and yet you are sure that a Gcode simulator shows nothing of that sort.

May I suggest trying to run the program to just prior to the wild excursion (a G0 move by the looks) so that you can
report the line number or there abouts of the faulty code.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Z axis craziness at program start
« Reply #7 on: November 08, 2017, 08:22:54 PM »
Try removing this line:

G28 G91 Z0.

And these two at the end.

G28 G91 Z0.
G28 X0. Y0.
« Last Edit: November 08, 2017, 08:24:26 PM by ger21 »
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Z axis craziness at program start
« Reply #8 on: November 08, 2017, 08:42:33 PM »
Try removing this line:

G28 G91 Z0.

And these two at the end.

G28 G91 Z0.
G28 X0. Y0.

That fixed the X and Y, Z is still off. BUT, you've given me a good idea of where to look.

THANK YOU.

Offline Iawa

*
  •  15 15
    • View Profile
Re: Z axis craziness at program start
« Reply #9 on: November 10, 2017, 05:24:19 AM »
I had the same problem and it was the G28 G91 Z0, Fusion should've installed Brackets which lets you view the code after you post and edit, when you post make sure the "Open NC file in editior" box is checked, saves putting it into mach and having to use notepad to edit, not a bad thing but its easier to read in Brackets.

The Z might be the G0 G43 Z?? which i think is applying tool length - i'm still new myself so i'd wait for someone to confirm or deny whatever i say before you try or test with no tooling or material with your finger on the shutoff - after looking at your Gcode it shouldn't be that, unless your Z axis is moving too many steps but it'd have to be very far out to be going 9" out.


Alex