Hello Guest it is August 09, 2022, 03:41:07 PM

Author Topic: Mill Turning_Need Advice with Mach3 Work Offsets!  (Read 2160 times)

0 Members and 1 Guest are viewing this topic.

Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #20 on: April 03, 2021, 10:16:48 AM »
Still did not get it how they will be displayed in the work offsets table. I am going to test the changes I have made so far and try it out few things regarding the work offsets table. Maybe I will understand like that. Sometimes I need to see things to get it better

Offline TPS

*
  •  2,315 2,315
    • View Profile
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #21 on: April 03, 2021, 11:09:39 AM »
in the work Offset table are no  G52 values, only G54 ...

G52 values are only avaliable in Vars (5211 ...)

so what is the problem to have these offset's stored in UserDro's like you did?
and why are you trying to store G52 offset's in work offset table?
for the moment i can't catch the entire Problem.
« Last Edit: April 03, 2021, 11:11:27 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #22 on: April 03, 2021, 02:53:28 PM »
in the work Offset table are no  G52 values, only G54 ...

G52 values are only avaliable in Vars (5211 ...)

so what is the problem to have these offset's stored in UserDro's like you did?
and why are you trying to store G52 offset's in work offset table?
for the moment i can't catch the entire Problem.

No problem at all. It's ok to have them saved in the screenset table I have made.
Graham in a previous post suggested that it's also possible to save G52 offsets in the workoffset table and I was just curious about it.
Anyhow run few tests and it seems to work really well. Modified the post processor to output a G0 Y0 X0 instead of only YO. To prevent crashes in case of diagonal long travels once the new offsets is called. Now it goes on top of the new offset and then start with the rest of the Gcode.

Here a short video showing same operation at different constant surface speed in 5 different locations. Once established the offset, I only need to change the G54 and the macro will take care of the rest.
Thanks a lot for the help!

https://youtu.be/ZUQ1dGvLo-Q
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #23 on: April 03, 2021, 06:45:54 PM »
Made a mistake on YouTube, I uploaded again on another platform 😊
<iframe title="vimeo-player" src="https://player.vimeo.com/video/532719675" width="640" height="360" frameborder="0" allowfullscreen></iframe>
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #24 on: April 03, 2021, 06:50:50 PM »
I was playing a bit with VB editor.
Does someone know if it is possible to reverse the sign of a DRO value?
Like in this code, would be possible to reverse the signs of the variables X,Y and Zdro? I couldn't find the VB code for it.

1st:
'Script to transfer X,Y,Z DRO to the corresponding G52 Px line in the table (each button transfers to different SetUserDRO ( *********x, Xdro) ecc...)
Xdro = GetOEMDRO (800)  'Get X DRO current working offset
Ydro = GetOEMDRO (801)  'Get Y DRO current working offset
Zdro = GetOEMDRO (802)  'Get Z DRO current working offset
SetUserDRO (1100, Xdro)
SetUserDRO (1101, Ydro)
SetUserDRO (1102, Zdro)

Offline Graham Waterworth

*
  • *
  •  2,459 2,459
  • Yorkshire Dales, England
    • View Profile
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #25 on: April 03, 2021, 08:34:27 PM »
The 'Work Offsets' are stored in a block of #Vars starting at #5221 for G54 X, #5222 for Y and #5223 for Z

To get to G55 you increment the base value by 20 so #5241 = G55's X value.

I have used this method for storing probed points and the like when the control had limited spare #vars.

I would suggest using G59 P100 and above to read and write user values.

So the base value would be #7201 for your tool one X value.

You can write them with #[7201 + [tool * 20]] = GetOEMDRO (800)

And read them with G52 X[#7201 + [tool * 20]], Y[#7202 + [tool * 20]], Z[#7203 + [tool * 20]] or use the Get/Setvar method or some variation of your own.

You can open the fixture table with Oem Code 122
Without engineers the world stops
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #26 on: April 04, 2021, 03:21:50 AM »
The 'Work Offsets' are stored in a block of #Vars starting at #5221 for G54 X, #5222 for Y and #5223 for Z

To get to G55 you increment the base value by 20 so #5241 = G55's X value.

I have used this method for storing probed points and the like when the control had limited spare #vars.

I would suggest using G59 P100 and above to read and write user values.

So the base value would be #7201 for your tool one X value.

You can write them with #[7201 + [tool * 20]] = GetOEMDRO (800)

And read them with G52 X[#7201 + [tool * 20]], Y[#7202 + [tool * 20]], Z[#7203 + [tool * 20]] or use the Get/Setvar method or some variation of your own.

You can open the fixture table with Oem Code 122

Woow! Ok this is something cometely new that I didn't know. Although I used Mach3 for the past 3 years everytime surprises me with a new aspect.
Thanks for the highlights.


Do you perhaps know the VB code to reverse the sign of a DRO? (I mentioned in the previous message).
Thanks a lot

Offline TPS

*
  •  2,315 2,315
    • View Profile
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #27 on: April 04, 2021, 03:32:12 AM »
is this what you are looking for to invert sign:

Code: [Select]
Xdro = GetOEMDRO (800)  'Get X DRO current working offset
Ydro = GetOEMDRO (801)  'Get Y DRO current working offset
Zdro = GetOEMDRO (802)  'Get Z DRO current working offset
SetUserDRO (1100, Xdro * -1.0)
SetUserDRO (1101, Ydro * -1.0)
SetUserDRO (1102, Zdro * -1.0)
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #28 on: April 04, 2021, 03:45:13 AM »
is this what you are looking for to invert sign:

Code: [Select]
Xdro = GetOEMDRO (800)  'Get X DRO current working offset
Ydro = GetOEMDRO (801)  'Get Y DRO current working offset
Zdro = GetOEMDRO (802)  'Get Z DRO current working offset
SetUserDRO (1100, Xdro * -1.0)
SetUserDRO (1101, Ydro * -1.0)
SetUserDRO (1102, Zdro * -1.0)

Ah right! That was easy. Thanks a lot

Offline kf2qd

*
  •  132 132
    • View Profile
Re: Mill Turning_Need Advice with Mach3 Work Offsets!
« Reply #29 on: April 19, 2022, 02:39:35 PM »
I think this will do what you want to do.

Yo know the offset of your first tool and you know the X offset from your first tool to every other tool in the block.

Parameter #5221 is G54X, #5222i is G54Y and 5223 is G54Z. #5241 is G55X, #5261 is G56X, #5281 is G57X and I think you should be able to see the pattern here.

So - to set several work offsets in X you worls do this -

%
(this assumes G54 it the first tool on the block)
(an this assumes that you only need to adjust the X value for the tools in the block )
(G54 will be set using whatever method you normally use to set a fixture offset)
(to set G55X for tool 2)
#5241=[#5221 + .875] (G55 is +.875 from G54)
#5242=#5222 (so the Y is correct)
#5343=#5223 (unless the Z locations change)
#5261=[#5221 +2.1] (G56 is +2.1 from G54)
#5262=#5222 (so the Y is correct)
#5363=#5223 (unless the Z locations change)

This also works for normal mill work.
G54
M98P1
G55
M98P1
G56
M98P1
(Do a tool change)
G54
M98P2
and so forth
Write this into the header of the programs that use this tool block and just set G54.