Hello Guest it is September 20, 2019, 09:29:08 PM

Author Topic: Tool Offset Macro...  (Read 24886 times)

0 Members and 1 Guest are viewing this topic.

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Tool Offset Macro...
« on: July 27, 2016, 01:24:51 PM »
Ok, been messing with the tool offset table, I think I have it sussed now but looking for a way to smarten up offset measuring.

I have attached a macro that sort of contains what i want (plus a lot of junk i think) but looking for help in tuning it up or replacing it.

What i want, what i really really want ;) is to fit the reference tool and zero that, then fit the new tool and run the macro and have it give me the resulting difference in length each time in a message box or similar.

Seems the tool table offsets are always negative if the new tool is shorter than the ref tool so the sign needs to be correct in the answer too.

I'm sure someone can assist, probably already been done a million times;)
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Tool Offset Macro...
« Reply #1 on: July 28, 2016, 09:55:47 AM »
Seems two macro's might be better, or one called one-time only from the other....

first one measures the ref tool and stores height in a #var

second one is then run once for each tool (if multiples) and simply compares the result against the #var and spits out the difference?

idea or not?
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Tool Offset Macro...
« Reply #2 on: July 28, 2016, 02:33:08 PM »
Ok, pulled apart a probe macro ;) Added a few lines of code, I think I'm getting there?

M1098 measures the reference tool and stores the distance in #var(500), this is only run once for a setting session.

M1099 measures a tool, then compares the length with the contents of #var(500) and spits out the difference which can then be entered into the tool table.

Untested as yet, the code runs ok but not tested properly.

My question now is - is this a correct procedure for populating the tool table ?

It seems to make sense to me at least - as long as the tool number on-screen matches the tool mounted, once the z axis is touched-off, all further tools are automatically set to the same reference.

I think that's what's needed :)
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline RICH

*
  • *
  •  7,361 7,361
    • View Profile
Re: Tool Offset Macro...
« Reply #3 on: July 28, 2016, 07:28:21 PM »
Have you considered just working in Machine coordinates with no offsets active for probing tools?
Probe with the  master tool which has no length, then any move / probing value is directly read and can be sent to the tool table for that tool number.
 
Then you can also write / have a few buttons to print, change, copy and rename / store to safe place your tool table.
Lots of ways to do it but I keep mine simple on the lathe.

Arm Chair Machinist lately....... :),

RICH

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Tool Offset Macro...
« Reply #4 on: July 29, 2016, 02:18:26 AM »
Hmm, any chance of a worked example of that method? Just a few lines of what happens....

Took me long enough to get my head round the little bit i have got it round so far :)

Thanks
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline Hood

*
  •  25,853 25,853
  • Carnoustie, Scotland
    • View Profile
Re: Tool Offset Macro...
« Reply #5 on: July 29, 2016, 03:01:32 AM »
Dave I have not really looked at what you have done as I am crap at VB and it takes me all my time to understand my own let alone someone else's ;) but I will tell you how I do things. As you know my tool setting is done outwith the spindle in  with the toolsetter I made up.

What I do is have the toolsetter fully down as its reference point and any tools I put in will be offset from that point. So this point will never change.
I have a Haimer 3D Taster I use for an edge/height finder and I have set that up via the height setter as offset 100. (could be anything but as I only have 96 spaces on my tool page, see pic , I chose 100 as an easy to remember offset) Also the tool page automatically gets the details from the tool table so it updates itself :)

I set up all the rest of the tools in the same manner.

When I put the Haimer in I call G43H100 and when it is zeroed onthe material I just zero the Z work coords, all tools are then correct when their offsets are called.

The VB I have in the button to transfer the height offset from the setter is as follows.

If GetOemLED(800) Then
MsgBox ("Mach In Reset, Enable and start again")
End
End If

Offset = GetOemDRO(1150)

SetOemDRO(1555,Question("Enter Offset Number"))

Tool = GetOemDRO(1555)

Code "G90" & "G10" & "L1" & "P" & Tool &"Z" & Offset
DoOemButton(121) 


On my lathe things are set up on the machine but in a kind of similar manner in as much as my reference for all tools is the Home position of the X and Z axis, something that again never changes.

Not sure if this is of any help at all but hopefully it will give you something to think about.

Oh and something else, the CSMIO hase a probing macro that can be modified, M31 macro, it writes to variables, might be worth looking at also?

Hood

Offline rcaffin

*
  •  1,003 1,003
    • View Profile
Re: Tool Offset Macro...
« Reply #6 on: July 29, 2016, 03:14:58 AM »
Seems to me that you can do all this with the Tool Table Editor TTE (for lathe work).
Note that I am using gang tooling, where all the required tools are mounted at the start.
I set up the reference tool (T0), then dial in the other tools one by one, and enter their offsets via the TTE. No macros needed at all. Very simple. (Save Settings!)
If I remove the gang block and replace it later, without touch any of the other tools of course, I just realign the T0. The previously saved Tool Table is reloaded at startup and everything is there again . It is worth noting that if I am using two different gang blocks, I can swap between tool tables by renaming the files. Works very well for me.

Cheers
Roger

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Tool Offset Macro...
« Reply #7 on: July 29, 2016, 03:22:25 AM »
Thanks Hood,

are you 100% in favour of the Haimer 3d taster over one of the simple 3d electronic probes?

Just asking as i can see benefits in both but the taster is around £350 so a big investment for me.

Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Tool Offset Macro...
« Reply #8 on: July 29, 2016, 03:24:55 AM »
Thanks Roger, this is on a mill with manual tool change, I'm not familiar with the lathe side of mach so don't know about the TTE.

I think my first step needs to be to get edge-finding and referencing sorted out as it impacts on all usage really.
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline Hood

*
  •  25,853 25,853
  • Carnoustie, Scotland
    • View Profile
Re: Tool Offset Macro...
« Reply #9 on: July 29, 2016, 03:48:53 AM »
The 3D Taster is one of the best things I have bought for the mill, the Gerrardi vice being the other.
I bought the taster from WNT , it is the HQ version I bought and it was on offer for a long  time , in fact I actually bought another as I was so impressed with it, see screenshot. Not sure how much they are now but usually they are about the £300 mark.
Hood