[SOLVED] I'm doing it wrong: Numbered System Parameters, unexpected results.

More
17 Jan 2017 15:24 - 17 Jan 2017 16:30 #85932 by clunc
[The quick answer to unexpected results is to "change expectations." I was expecting the wrong thing from a numbered parameter, #5243, but found another, #5422, to use to get an expected behavior.]

I'm making copies of an object by using G55 to move to a new center point and then setting G56's X0Y0 origin to that point to cut it out.

I have had a couple of close calls when I inevitably forgot to set G56's Z identical to G55's Z before starting the program.

So, I got the bright idea to do it in the same G10 L20 P3 statement I use to reset G56's origin; this way,
G10 L20 P3 X0Y0 Z#5243
with reference to this section in the G-code Overview.

Then however, I did something unusual for me: I tried to verify that it did what I thought it would.

Looking at the output of the two DEBUG statements, the G10 L20 did not change G56's Z to G55's Z, although it changed to something else. (Note the M2/stop after the second DEBUG kills the program during the first iteration of the do-loop.)


Can someone explain what I'm doing wrong?

[Also, I'm merely curious about the "gaps" between the Numbered Parameters; e.g., between the G54's #5221-#5230 and the beginning of G55's, which starts at #5241. Are those parameters reserved for future expansion (more axes possibly) or do they have current use?]

Thank you.
Attachments:
Last edit: 17 Jan 2017 16:30 by clunc.

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

More
17 Jan 2017 16:03 #85937 by clunc
"Could it be that, for example,"

The Numbered Parameter #5243 refers, NOT to the current value of Z in UCS G55, BUT to the current value of the Z-offset (from G53/absolute/machine's origin) to the Z=0 origin in UCS G55?

I would like to know how to reset the value of G56's Z-coordinate to the current value of G55's.

Thank you.

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

More
17 Jan 2017 16:27 - 17 Jan 2017 16:32 #85945 by clunc
This seems to be the answer, from the same section in G-code Overview noted above:

* 5420-5428 - Current relative position in the active coordinate system including all offsets and in the current program units for X, Y, Z, A, B, C, U, V & W, volatile.


#5422 appears to refer to "the current value of Z in the current user-coordinate system."

This snippet works to set G56's current value of Z to G55's:
G56
(DEBUG, UCS:#5220 3=>G56::Z:#5422)
G55
(DEBUG, UCS:#5220 2=>G55::Z:#5422)
G10 L20 P3 #5422
G56
(DEBUG, UCS:#5220 3=>G56::Z:#5422)
Last edit: 17 Jan 2017 16:32 by clunc.

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

More
19 Jan 2017 00:12 #86109 by andypugh
You can also (maybe) use the named parameter #<_Z>

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

Time to create page: 0.096 seconds
Powered by Kunena Forum