Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: amstanley on April 25, 2018, 09:05:00 PM

Title: Mach3 Rotary Axis: how to return to zero position from -500k degree position...
Post by: amstanley on April 25, 2018, 09:05:00 PM
Hi guys, bit of an unusual one here...

I am using Deskproto as a g-code generator,
on an x-carve modified with an A-axis.
running G-code for a tutorial you can find here:  https://www.deskproto.com/gallery/venus.php

On the clearing pass I am using a milling strategy called 'helix' where the g-code essentially runs from one end of the workpiece to the other in a long single pass.
sort of like Meg Ryan peeling the apple in Sleepless in Seattle, in one long cut of the knife...

On a test run I noted that the A axis accumulated a very significant value, on the order to -500k, after about 50% of the g-code lines.
It made me wonder how I will be able to set the axis to zero when the run is finished,
without having to 'rewind' all those turns, which is what would happen if I simply issue a command for 'g0 a0'

anybody have any advice on how to return to zero easily when the A axis value is significant?
Thanks in advance for any help...

 
Title: Re: Mach3 Rotary Axis: how to return to zero position from -500k degree position...
Post by: Tweakie.CNC on April 26, 2018, 01:44:24 AM
Some Gcode you could try...

G1 A *********x  (where *********x is a multiple of 360 and a number close to the existing A axis DRO reading)
#99803=0
%

This should rotate the A axis to a multiple of the zero position with minimum rotation then reset the A axis DRO to zero.
You could then goto zero on the other axes in the usual way.

Tweakie.
Title: Re: Mach3 Rotary Axis: how to return to zero position from -500k degree position...
Post by: rhtuttle on April 26, 2018, 11:02:26 AM
Possibly rework your code to work in incremental rather than absolute coordinates g91/g90

HTH

RT
Title: Re: Mach3 Rotary Axis: how to return to zero position from -500k degree position...
Post by: garyhlucas on April 26, 2018, 01:02:11 PM
Yes it would be nice to know how to do this as it would allow threading on my fourth axis which is stepper driven. The threading ‘tool’ could be a lathe tool or the mill spindle with a shaped cutter.
Title: Re: Mach3 Rotary Axis: how to return to zero position from -500k degree position...
Post by: RICH on April 27, 2018, 06:38:39 AM
Add the following  M1010.M1S file to the the     C:/Mach3/macros/ Mach3Mill    
folder ( the folder represents the profile you are using).
When you input M1010 in the MDI line it will zero the X,Y,Z A axes and also set the work
offsets to zero. Place a comment mark in front of any line in the M   code which you do want
to use ie;    ' SetMachZero ( 0 )  or    ' Code "G92.1"   .
Change the G10 command  to     G10 l2 P1 A0   if you only want to reset the A  axis work offset.

RICH