Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Allen McFarlen on October 09, 2017, 04:47:47 PM

Title: How do I get to the center of 2 edges?
Post by: Allen McFarlen on October 09, 2017, 04:47:47 PM
I use a Haimer 3D mechanical probe to locate parts and for the life of me I can't find the method to find the center of a part in Mach4.

Here's the scenario. I have a part in my vise and I need to reference the center of the Y axis. In Mach3 I would indicate of the Y+ and zero the DRO, move to the Y- and then in DRO output I could add " /2" and the DRO would update with the number. Then all I had to do was to jog to the 0.000 position of the Y axis. This also a very similar process on my manual mill with a DRO.

But in Mach4 this doesn't work for me. The DRO ignores the "/" and will just update with the number 2.

I can't find any method to achieve the same result. Am I missing something obvious due to inexperience with Mach4, or is this feature not possible?
Title: Re: How do I get to the center of 2 edges?
Post by: garyhlucas on October 09, 2017, 07:38:25 PM
Allen,
I learned something new here, didn’t know mach 3 would accept divide by 2 in a DRO! However I have always done what  you want to do by dividing the DRO value by two and entering that value. Interested in seeing what are told by others.
Title: Re: How do I get to the center of 2 edges?
Post by: Fledermaus on October 10, 2017, 04:46:27 AM
Faced with this same issue I added X/2 and Y/2 buttons to the offsets tab. These behave exactly as per a physical dro and divide the axis dros by 2.

Allan
Title: Re: How do I get to the center of 2 edges?
Post by: Fledermaus on October 10, 2017, 05:50:08 AM
The button code needed is simple. Here is what I used for X/2; Y*2 is similar:

--AW. Halve X axis position for centring
local inst = mc.mcGetInstance()
local val = mc.mcAxisGetPos(inst, mc.X_AXIS)
local rc = mc.mcAxisSetPos(inst, mc.X_AXIS,  (val / 2))

You might want to set EnableWithMachine for these buttons.

Allan
Title: Re: How do I get to the center of 2 edges?
Post by: Fledermaus on October 10, 2017, 06:18:51 AM
If you want to try my ready made solution, here is an export of my Offsets tab.  After backing up your current screen set, import the revised tab into the screen tree. As i have also modified the 6 offset buttons, which in some circumstances might not have indicated the current offset, you will also need to add the function ShowFixedOffset() to the screen load script.

Allan
Title: Re: How do I get to the center of 2 edges?
Post by: Cbyrdtopper on October 10, 2017, 10:21:48 AM
Fledermaus,
That is an elegant solution, and I'm going to use it.  ;)
I too liked the ease of "/2" in mach3 but it is annoying in Mach4 to not be able to have this functionality. 
I did just as Allen, find my edge, zero, find the 2nd edge and then divide it in the calculator and enter the result in the DRO.
Title: Re: How do I get to the center of 2 edges?
Post by: Stuart on October 10, 2017, 02:07:14 PM
Just turn on the dro calculator from the menu bar
Title: Re: How do I get to the center of 2 edges?
Post by: Cbyrdtopper on October 10, 2017, 02:17:36 PM
I had no idea that was there, Stuart.  I wish it would link to your keyboard instead of having to use the mouse; that would be nice.
I did implemented Allan's button idea onto a mill here in the shop.
I think I like it better still.  It's in the offset tab and it is a simple mouse click to get the desired input into the DRO.
Title: Re: How do I get to the center of 2 edges?
Post by: Allen McFarlen on October 10, 2017, 03:50:18 PM
Didn't know there was a DRO calculator in the menu bar. I'll have a look at that tomorrow, and see if it will do what I want. Otherwise the solution of Allan's looks like it's the go.

Thanks for the help.
Title: Re: How do I get to the center of 2 edges?
Post by: Allen McFarlen on October 11, 2017, 08:37:18 PM
I've had a look at the menu bar and clicked on the DRO calculator, but nothing happens. No popups....nothing. Using Mach4 2.0.3481 Hobby with Warp9 ESS 2.10

Am I missing something obvious once again?
Title: Re: How do I get to the center of 2 edges?
Post by: joeaverage on October 11, 2017, 09:59:24 PM
Hi,
with the DRO calculator active place the cursor over the Xaxis DRO and click, advanced calculator screen hover over
Y axis and click. I was trying to get it to work last night...and thats what I found.

Craig
Title: Re: How do I get to the center of 2 edges?
Post by: Allen McFarlen on October 11, 2017, 10:06:36 PM
I'll give that a go.

I've been trying to add the button script that Allan posted but it seems to elude me. Or how to importing a tab into the screen tree with his tabOffset.zip that he provided.
Title: Re: How do I get to the center of 2 edges?
Post by: Allen McFarlen on October 11, 2017, 10:10:35 PM
Just tried the DRO calculator as you described and that works a treat. Really all that I need it to do.
Title: Re: How do I get to the center of 2 edges?
Post by: rhtuttle on January 24, 2018, 01:08:10 PM
Not sure why I would want it on lathe but it doesn't work in the wxLathe.set
Title: Re: How do I get to the center of 2 edges?
Post by: joeaverage on January 24, 2018, 04:06:55 PM
Hi,
I suspect its a module and it may not be included in the latheprofile.

Craig