Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: ulihuber on February 15, 2010, 08:13:11 AM

Title: Rotary axis zeroing problem
Post by: ulihuber on February 15, 2010, 08:13:11 AM
Hi,

in the German CNC-Ecke we are discussing a problem with the rotary axis.

If "Ang. Short Rot on G0" is active and the DRO for the A-axis is a multiple of 360, there is no movement when executing "G0 A0".
That's exactly what it should do.
But there is also no change in the DRO value. It stays just as it was before the move and does not switch to '000'.

Any ideas about this effect ?

Thanks
Uli
Title: Re: Rotary axis zeroing problem
Post by: Hood on February 15, 2010, 08:46:12 AM
I am not really understanding what you are meaning. As far as I understand the setting "Ang Short Rot on G0" should move the axis to zero if you are not already there. If for example you were at 100 then it would move backwards to zero, if you were at 200 it would move forward to zero, ie taking the shortest path.
Hood
Title: Re: Rotary axis zeroing problem
Post by: ulihuber on February 15, 2010, 09:03:26 AM
Yes. It should move on the shortest path, what it does in fact.
But if the actual position is a multiple of full turns to the commanded position, there is no move to do.
The axis doesn't move which is what it should do.
But the DRO value remains the old one, it does not change to the target position.

Example:
DRO for A is '0'
G1 A3600   --> Axis moves. After move DRO shows 3600
G0 A0        --> Axis does not move at all, because way to go  is 10x360°
                     After move,  DRO still shows 3600

Uli
Title: Re: Rotary axis zeroing problem
Post by: Tweakie.CNC on February 15, 2010, 09:12:53 AM
Surely 360.000 is exactly the same as 000.000 as far as Mach is concerned when the axis is set for continuous rotation ?.
My A axis often reads 360.000 when it has be zeroed but it has no effect (that I have yet discovered) on subsequent moves.

Tweakie.
Title: Re: Rotary axis zeroing problem
Post by: Hood on February 15, 2010, 09:22:21 AM
Ah ok obviously you are not using the rotational roll over, that is where I would see the use for the short rotation move. I will have to think about what you are trying to do.

Hood
Title: Re: Rotary axis zeroing problem
Post by: RICH on February 15, 2010, 09:24:14 AM
What version Mach version are you using as i don't remember that happening here ( ver 033), but, will recheck it later on.  Maybe i had the 360 rollover checked.

Rot 360 rollover – if checked the A axis DRO will display from 0 to 360 degrees and then start over at 0. If not checked the A axis DRO will be additive such that 2 revolutions will display as 720 degrees.

Ang Short Rot on G0 – The axis will move in the shortest possible move to a new position. So if at 0 degrees and you jogged  to 359 deg then it would just rotate  -1 degree.

Hood, you beat me to it,
RICH
 
Title: Re: Rotary axis zeroing problem
Post by: RICH on February 15, 2010, 09:25:40 AM
Also what mode are you in, incremental or absolute.
RICH
Title: Re: Rotary axis zeroing problem
Post by: Hood on February 15, 2010, 09:32:44 AM
Are you just trying to reset the A DRO to zero?
If yes do you home the A Axis?

Hood
Title: Re: Rotary axis zeroing problem
Post by: RICH on February 15, 2010, 10:11:16 AM
If it is a lathe, use Phil's screen as it has the button already there for it.
RICH
Title: Re: Rotary axis zeroing problem
Post by: ulihuber on February 15, 2010, 11:43:58 AM
Rich,

here on my PC it's R 3.042.020 with the 1024 standard screen but it seems to happen with other versions as well.
This is in absolute mode.

About what the guy is trying to do:
He uses the rotational axis to mill a thread on a rod. He does it to a depth of 1mm in let's say portions of 0.25mm.
So it is something like

g0 z1
g0 x0
g1 z-0.25
g1 x10 a3600    ; make 10 full turns to get a spacing of 1mm on a length of 10mm
                       ; We are at x10 and a3600 now
                       ; Then a second path is needed.
g0 z1
G0 x0 a0          ; Without the Ang Short Rot it's a full 10 turns back :-((
                      ; with Ang Short Rot  we are already there and do not haveto do more  than moving x to zero. That's much better :-))

But if a stays at 3600, the next pass has to go to 7200 and so on.
And there is no explanation why a stays at the old value.

Uli
Title: Re: Rotary axis zeroing problem
Post by: Hood on February 15, 2010, 01:13:23 PM
I think you are misunderstanding what that setting does. If Rot Rollover is selected it will move the shortest distance to the position specified but if rot rollover is not chosen then the axis will be temporarily seen as a position in relation to 0 and 360 degrees and it will move to that position by the shortest route, it will not zero the DRO which I think you are wanting.
To zero the DRO you could use the screen button or write a custom macro and insert the m code for it in your G code at the appropriate point.
Hood
Title: Re: Rotary axis zeroing problem
Post by: ulihuber on February 15, 2010, 01:41:17 PM
Sorry Hood,
I don't think I am misunderstanding the function.  It should be shortest path to the -commanded- position while avoiding unnecessary turns. This normally assumes that not only the move is executed to bring the mechanics to this position, but also that position counters are set to whatever was the end-position of the move.
If not, please tell me what advantage is has to keep the old position instead of the new one.
By the way - it is not 'zeroing the axis' in general. Just in this example it was to return to the position '0'.

No doubt, a macro may correct this problem.  But I am really advocating MACH3 and I'd love to understand why this works as it works. And if it's not a design intend, why it is not seen as a problem/mistake.

Uli
Title: Re: Rotary axis zeroing problem
Post by: Hood on February 15, 2010, 01:57:12 PM
Well I will try and explain as I understand. The feature is really meant for use when using Rotational Roll over so that it will move the shortest distance to the position you command. Now because you do not have that checked it will temporarily treat the position it is at as a position of a rotation, eg if at 3599 degrees and you commanded a G0A0 it would move one degree forward and the DRO would read 3600 degrees, if you were at 3601 degrees and commanded the G0A0 it would move back one degree and the DRO would read 3600 as before.
 If you want to reset the zero position on the axis you will either need to do a home move, press the zero axis button or if wanting to do it from within code you can as said write a ciustom macro and have the m code for that macro in your G Code.

Hood
Title: Re: Rotary axis zeroing problem
Post by: ulihuber on February 15, 2010, 02:18:18 PM
Hood,

please let me know, what use I can make of the fact that a move G0 A0 ends at a position of A3600 ?
This makes no sense for me. If I say 'G0 Ax' I expect the axis to be at x at the ende of the move. Both, mechanical and logical.

Uli

Title: Re: Rotary axis zeroing problem
Post by: Hood on February 15, 2010, 02:23:00 PM
Uli
 What you are attempting to use this function for, is as far as I can see, NOT what it is intended for. I see it as a means of indexing the rotational axis to a desired position  within its rotation, if you are wishing to reset the DRO to zero then you should write a macro which will do what you want.
Hood
Title: Re: Rotary axis zeroing problem
Post by: ulihuber on February 15, 2010, 02:48:37 PM
Hood,

it looks like we'll not find together...

Anyways. For me, it makes no sense to misuse a command to to something that is completely different from it's normal function just because a switch is set.
I'd have no problem with whatever additional G-command to do something like 'move rotational axis to a modulo position'.
A G0 command has to end at the commanded position, completely independend from what else could be desirable in very specific other situations.

But let's stop here before this discussion is going to be the neverending story.

I have my opinion, you have your's.

Thanks
Uli
Title: Re: Rotary axis zeroing problem
Post by: Hood on February 15, 2010, 03:33:15 PM
I have the opinion that it is meant to be used in conjunction with the rotational rollover mode and when used with that it acts exactly as it should do. It may well be that it is meant to work differently if you do not have rotational rollover chosen.

Hood
Title: Re: Rotary axis zeroing problem
Post by: RICH on February 15, 2010, 04:17:15 PM
Quote
what use I can make of the fact that a move G0 A0 ends at a position of A3600

I see what you mean, once A is set to home ( Zero world A axis here ) / there are no offsets for  A, machine coordinates will / are  keeping track of ALL the rotations.
You can at any time change A to 0 for the  program coordinates and that will not change the machine coordinates, if you do a G28 A0 it will home the A axis back to 0 doing  as many rotations as you have totaly moved.  Now if you G0 A-3600 for example it will go back to A = 0.

Thinking we / you / I need to look at Program and Machine coordinates and  get a better understanding of how things are being kept track of and then relate the appropriate G0 A... move for what needs to be done with different settings.

That said, just don't assume how something is supposed to work, need to see how it all works in light of it all. Not saying that anybody is right or wrong, just that from a simplistic read of the definitons of those posted config settings.....well, can get confusing if you go beyond them.

Will also add, not knowing the logic of the program writer,guess will need to figure it out, accept it or make recommendation for change which is more logical if logical. Hmm....sounds like Spock from StarTrek.  ;D

RICH
 
Title: Re: Rotary axis zeroing problem
Post by: Overloaded on February 15, 2010, 04:51:12 PM
I have the opinion that it is meant to be used in conjunction with the rotational rollover mode and when used with that it acts exactly as it should do. It may well be that it is meant to work differently if you do not have rotational rollover chosen.

Hood

I think Hood nailed it here.
Perhaps the need never arose or it was never considered to zero the axis after the short trip to the nearest increment of 360.
Would be a shame to request Brian to drop what he's doing to look into fixing it in the code when a simple "DoOEMButton 1025" in a M call works beautifully.

I learned some good stuff here today,
Thanks :)
Title: Re: Rotary axis zeroing problem
Post by: ulihuber on February 15, 2010, 05:16:08 PM
Folks,

I certainly can live with any call in a macro.

I did not want to stress it again, but as it appears over and over ....
No, I do not expect to zero the axis after a short move just because it's target position is by chance at a mechnical zero position.
What I expect is that whatever move I make, the result in the DROs is the commanded position. No matter it there was a physical move, it this was clockwise or counter-clockwise, short or long.

My English language will never meet Rick's sophisticated constructions. Hopefully the long discussion is not the result of me sounding like Dr. Strangelove. ;-)

Uli
Title: Re: Rotary axis zeroing problem
Post by: Overloaded on February 15, 2010, 05:34:52 PM
What I expect is that whatever move I make, the result in the DROs is the commanded position.  Uli

I understand what you are expecting... but for whatever reason, Mach is evidently not coded to accomidate us in this respect.
It would be nice if it would read 0.0 , don't see any reason why it shouldn't, maybe it could go on the "ToDo" list. 
Thanks for bringing it to light though, now we all know how to work around it.
 :)
Title: Re: Rotary axis zeroing problem
Post by: RICH on February 15, 2010, 06:00:13 PM
Uli,
Glad you posted. This is a good discussion. I sometimes only wish that there was a one place stop to grasp all the things associated with using the rotary axis. In fact i started a write up about it but got side tracked in the last few weeks. So anything posted  is of value for me no matter what it is.
 
RICH

Title: Re: Rotary axis zeroing problem
Post by: Hood on February 15, 2010, 07:05:21 PM
As said previously I think this feature is meant to be used with Rot Roll Over but I can see it would be handy if not in that mode.

Anyway just been farting about with this, was thinking the macro to do the zero button would be fine if you were actually wanting it to zero but say you wanted it to do a short rotational move to A10 from the A3600 it wouldnt be so easy.
Anyway heres what I came up with, probably a simpler method as I always do things weird.
Ok so first thing would be to command a G0A10, that would move the axis to A3610 then call your user macro which would have something like this

Old = GetOemDRO(803)
Wanted = (Old Mod 360)
Call SetOemDRO(803,Wanted)

That would then set the DRO to 10,

same if you wanted for instance to  end up at A265, , you would command a G0A265 and the axis would move to A3505 then call the macro and the DRO would read 265.

Hood
Title: Re: Rotary axis zeroing problem
Post by: alenz on February 17, 2010, 04:46:20 AM
There appears to be another bug in the rotary axis that bit me. The following code drills 4 holes 90 deg apart and works as expected one time but one time only. Hit cycle start the second time and it goes bonkers. On line N110 it goes backwards a full revolution but worse yet the Z travels down concurrently. NOT GOOD. This was with Rot 360 rollover and Ang Short Rot on G0 both checked but other combinations do the same thing. Exiting and restarting Mach is the only way I know to get back to normal.  I did discover that adding line N25 G92 A0 will cause it to work every time but that shouldn't be required. (But it might be a clue).

N10 G00 Z.050
N20 G00 X0 Y0
(N25 G92 A0)
N30 #1 = 0
N40 M98 P10 L4
N50 G00 Z.25
N60 G80
N70 M30

O10
N80 #1 = [#1 + 90]
N90 G00 A#1
N100 G01 F20
N110 G81 Z-0.25 A#1 R.025
N120 M99
%

 I would be curious to see if this can be repeated on someone else’s machine. It is repeatable on 2 PC’s here.
Thanks, Al
Title: Re: Rotary axis zeroing problem
Post by: Tweakie.CNC on February 17, 2010, 05:15:36 AM
Hi Al,

Just tried your code and same thing - works fine first run only. (It seems that it wants to rewind the A axis back to zero but very slowly on the second run).

Tweakie.
Title: Re: Rotary axis zeroing problem
Post by: Overloaded on February 17, 2010, 07:12:15 AM
Hi Al and Tweakie,
  Just curious, why is the A#1 in line N110 ?
I put (A#1) instead and all seems well.
Otherwise, it does the same here. Looks like an interpolated move...Z-0.25 A#1.
Russ
Title: Re: Rotary axis zeroing problem
Post by: Tweakie.CNC on February 17, 2010, 07:46:48 AM
Looks like you have solved the mystery Russ.  :)

Tweakie.
Title: Re: Rotary axis zeroing problem
Post by: alenz on February 17, 2010, 05:55:42 PM
Thanks Russ and Tweakie, my bad. Sometimes the longer I look at the obvious the less likely I am to see it :(. There was no reason for an A word in that line, (although  I still don’t see why it did what it did since it was already at that position).
Thanks again,
Al