Resetting Rotary Axis to Zero

More
15 Jun 2018 02:21 #112388 by Sparky961
After completing a program that involves multiple turns of the rotary axis, I'd like to return to my start position for the next cycle. I want this to happen without having to "unwind" the rotary axis, rather just have it return to the nearest zero equivalent position.

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?
More
15 Jun 2018 11:15 #112397 by BigJohnT
G92 works for me in a simulator. Move to the nearest position ie. if your at 739 move to 720 and say G92 A0.

JT
More
15 Jun 2018 12:18 #112400 by Sparky961
After reading the details for G92 I wonder if this wouldn't have the same effect as G10 L20. It uses an offset to zero the current position, so if my position was always some positive number when the program completes then the absolute offset would be increasing by that amount every cycle. Some might argue this isn't a problem because the number is so big, but because it's so big it's also hard to test what happens when the number overflows.

This is all speculation though, as I haven't tried it yet. I will do so. Thanks for suggesting another option.
More
15 Jun 2018 21:28 #112440 by MaHa
Replied by MaHa on topic Resetting Rotary Axis to Zero
I use this to prevent unwind A-axis:

G10 L20 P#5220 A[#5423 MOD 360]
The following user(s) said Thank You: nkp
More
16 Jun 2018 01:22 #112454 by Sparky961

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.
Time to create page: 0.063 seconds
Powered by Kunena Forum