Hello Guest it is March 28, 2024, 07:45:49 AM

Author Topic: Need Help on Lua Calc and Tab setup  (Read 1332 times)

0 Members and 1 Guest are viewing this topic.

Offline Mauri

*
  •  328 328
    • View Profile
Need Help on Lua Calc and Tab setup
« on: March 28, 2017, 03:52:59 PM »
Hi,
I have used the Daz code for the Homing of X/Y/Z Axis with Soft Limits button Off when I home it makes X/Y/Z all Zero. (0/0/0)
When I then move X/Y to where I want to Centre of my part the DRO shows that Position. (175/75/0)
When I Zero the DRO for that Position these values then go to the Machine Coordinates. (175/75/0)
When I load a G-Code for example a Circle say 100mm dia., the Program extents show the following (example):
X Min = 125        X Max = 225
Y Min = 25          Y Max = 125

Now what I would like is another Tab showing “Part Extents”
Minimum            Extents                 Maximum
-50.000                 X                             50.000
-50.000                 Y                              50.000

Using Program Extents and Machine Coordinates I would like the following calculation to display the number above.

Xminpartextents = X Program Extents Min - X Machine Coordinates Min               (-50=125-175)
Xmaxpartextents = X Program Extents Max - X Machine Coordinates Max            ( 50=225-175)
Yminpartextents = X Program Extents Min - X Machine Coordinates Min               (-50=25-75)
Ymaxpartextents = X Program Extents Max - X Machine Coordinates Max            ( 50=125-75)

We machine a number of circular medallions and each side require multiple cuts over a number of days, we therefore need to be sure that it is always in centre position. In the past we have had power failures and the tip of the .1mm cutter broken plus the restart of the Mill the next day.
So this display will quickly show that we are still on centre with the Part without having to do any manual calcuations.
Can anyone please help me with this as my Lua is very weak in this area?

Regards,
Mauri.

Offline Mauri

*
  •  328 328
    • View Profile
Re: Need Help on Lua Calc and Tab setup
« Reply #1 on: March 28, 2017, 09:08:56 PM »
Hi,
I can get the value for min/max Machine Extents, But cannot get the DRO Machine Coordinates value.
I have tried "X Machine Pos" and "dro Machine Coordinates X(1)" but get no numbers.
Machine Coordinates are not stored in the Register.
I am not sure it is stored anywhere.
Does anyone know how what Lua code is required to get the Machine Coordinates values?
Regards,
Mauri.

Offline Mauri

*
  •  328 328
    • View Profile
Re: Need Help on Lua Calc and Tab setup
« Reply #2 on: March 28, 2017, 09:30:50 PM »
Hi,
I have worked it out myself.
Regards,
Mauri.