Resetting Rotary Axis to Zero

More
8 years 4 months ago #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?

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago #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

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago #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.

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago #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, alan_3301, cadcam

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago #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.

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago #112756 by andypugh

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.

Please Log in or Create an account to join the conversation.

Time to create page: 0.321 seconds
Powered by Kunena Forum