Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: krymis on November 12, 2009, 03:57:33 PM

Title: adding stop to all z movement
Post by: krymis on November 12, 2009, 03:57:33 PM
is there any way to add an M01 stop before any z movement?  I don't have my z axis all set up yet but wanted to play around a little.  I have code written but do not want to go through all the lines to add in an M01 for all z movement.  Any help would be appreciated. 
Title: Re: adding stop to all z movement
Post by: jimpinder on November 13, 2009, 03:56:30 AM
I am not quite sure what exactly you are wanting, here.

On Mach 3 you say you do not have the Z axis set up.  However, If you are worried about it moving, it implies that it is fitted and working ??

You can try two ways -  On config/ports and pins - turn the z axis off. I haven't tried this - the Z axis will not work, but whether Mach says - "You are trying to move the Z axis and have it turned off so I will not play" I don't know.

The other way is disconnect the step and direction wires to your stepper driver or whatever, and turn the power off to the drive. The Z axis will definitely not work, and since you are not affecting the "computer" side of the set-up, Mach will be unaware that any thing is wrong.

You MUST make sure, however, that the X,Y movements you make do not depend on a particular height of Z, e.g. to miss a clamp of anything - make sure z is fully up and out of the way.
Title: Re: adding stop to all z movement
Post by: Tweakie.CNC on November 13, 2009, 06:12:38 AM
Most controllers have an 'enable' input for each  axis (check your manual) and I have each of mine connected through a switch to ground so I can easily disable any axis.
As Jim has said Mach is unaware of this and runs as normal.

Tweakie.
Title: Re: adding stop to all z movement
Post by: Hood on November 13, 2009, 06:31:24 AM
I believe you may be wishing the code to halt on a Z move so that you can manually position the Z. If that is the case then afraid as far as I know the only way would be to add M1's in your code at the Z moves. Once you have the Z working under CNC then you can still use the same code, just turn off the Halt on M1 command.
Hood
Title: Re: adding stop to all z movement
Post by: krymis on November 13, 2009, 06:44:37 AM
hood is correct as o what i am trying to do.  thanks to all for the help
Title: Re: adding stop to all z movement
Post by: alenz on November 13, 2009, 06:31:39 PM
Here is a little program that will add an M01 (or whatever you like) just before each Z.
HTH Al
PS  Note iit isn't quite finished but will do what you asked.


OK it's now finished.
al
Title: Re: adding stop to all z movement
Post by: krymis on November 14, 2009, 02:58:56 PM
alenz,

bud you are a lifesaver.  I really appreciate that.  So far it looks as though that program will work perfectly.  Thank you so very much
Title: Re: adding stop to all z movement
Post by: Tweakie.CNC on November 15, 2009, 02:39:04 AM
Excellent program Al.

Tweakie.
Title: Re: adding stop to all z movement
Post by: alenz on November 16, 2009, 04:45:46 AM
Guys, thanks for the feedback. It was a fun little project. Now I just wish I could think of a good use for it  :).
Al
Title: Re: adding stop to all z movement
Post by: Tweakie.CNC on November 16, 2009, 05:57:02 AM
"Adding a stop to all Z movement" sounds good Al.  ;D

Tweakie.
Title: Re: adding stop to all z movement
Post by: alenz on November 16, 2009, 06:54:58 AM
"Adding a stop to all Z movement" sounds good Al.  ;D

Tweakie.

Ha Ha, yeah I should have said "Another good use". I doubt if anyone other than Krymis will ever use it for that. But, who knows, I might need to find and flag a particular piece of code sometime myself.
And like I said it was a fun piece and I needed to refresh my (failing) memory of VB6.
al