Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: shapeshaver on July 18, 2014, 11:06:09 AM

Title: G code method to Zero an axis
Post by: shapeshaver on July 18, 2014, 11:06:09 AM
I have a custom machine that pulls a long length of coiled material through it along the Y axis.  The Y axis is stationary and does not move, the material is moved incrementally in the specified direction for each Y axis move command. I have 100' coils of material and the parts vary in length.

When I reach the end of the G code file, what can I include at the end of the file (or the beginning of the next G code file) to set the Y axis position back to zero or some defined value to be ready to cut the next file? I would need to leave the X and Z values unchanged.
Title: Re: G code method to Zero an axis
Post by: Hood on July 18, 2014, 02:40:48 PM
You can make a custom macro up, just have it set the Y DRO to whatever you want.

For example if you open notepad and type in

SetOemDRO(801,0)

Then save it as m123.m1s to the macro folder of the profile you are using. Then every time you have m123 in your G Code the Y Dro will be set to Zero.
Hood
Title: Re: G code method to Zero an axis
Post by: shapeshaver on July 21, 2014, 11:46:52 AM
That was exactly what I was looking for and it works great!

Thanks Hood!