Resetting Rotary Axis to Zero
I know that WRAPPED_ROTARY=1 is one way to accomplish this, but using this would mean that I'd need to write all of my combined motion in incremental mode, which I do not want to do for more than a few reasons.
I also know that I can put values into the axis position registers using G10 L20 Pn B0. I see that G10 L2 is supposed to write a value to the coordinate system regisiter but when I do this the position changes accordingly. I'm not able to reset both of these. If I don't, I will have an accumulating offset every time a cycle is run.
I want the equivalent of homing - where I tell it "this is zero", period. Is there a good way to accomplish this from G code?
This is all speculation though, as I haven't tried it yet. I will do so. Thanks for suggesting another option.
MaHa wrote: I use this to prevent unwind A-axis:
G10 L20 P#5220 A[#5423 MOD 360]
This is much more clever than just using G10 L20 P1 A0 like I was. Yours accounts for different coordinate systems in effect and "rewinds" to the same angle but in the 0 -> 359.999 range.
However, it still has the issue of an increasing offset every time you do it. For most people this won't become an issue, but this machine will be running the same program over and over day after day, week after week. I don't want to leave this to chance.
Sparky961 wrote: However, it still has the issue of an increasing offset every time you do it. For most people this won't become an issue, but this machine will be running the same program over and over day after day, week after week. I don't want to leave this to chance.
You probably don't need to worry about this. The position is calculated using double-precision float.
This has 17 significant digits. Assuming that you have 4 decimal places displayed you will start to see a loss of precision in the last digit in 10000000000000 degrees. That's 52 years of turning at 1000 rpm for 24 hours a day.
So I tried it in a sub-routine at the end of a sub-path and it works! It seems to mathematically take away all full 360 degree rotations and leaves the remainder, a big help. I like to get back to zero so I can visually make sure nothing wonky happened since I don't fully trust my mechanics, so I just add "G0 A0" to the sub-routine and it essentially homes. Fantastic! and Thanks!
Badger wrote: I haven't tried this yet but I assume it will work and be of great benefit to my particular situation. My question is why/how does it work? I've looked the DOCs and googled it but its still as clear as mud to me.
The key sections are:
linuxcnc.org/docs/2.7/html/gcode/overvie...ode:binary-operators (though that does rather assume that you already know what the modulus operator does)