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

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

0 Members and 1 Guest are viewing this topic.

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Tool Offset Macro...
« Reply #170 on: August 25, 2016, 07:18:41 AM »
Routine might be something like this...

height setter empty,
user invokes macro,
macro zero's A dro,
user msg - place tool,
user respond - mach goes out of reset to get reading,
put mach back in reset,
user question - tool number,
macro saves reading to tool table

Would need to get smart so that the two parts of the process are invoked from the one screen button, maybe look at A axis DRO or set a temp #var ???
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 #171 on: August 25, 2016, 07:51:42 AM »
I think the oder will have to be

Out of Reset, Zero DRO (Don't think Mach allows you to zero whilst in Reset)
In Reset, move setter and put tool in.
Out of Reset and update table from DRO.

I think you should be able to do it with message boxes but not sure.

So Have  code in button telling you to take Mach Out  of reset. Pops up message box.
Press Reset  then  OK Message box,  Mach now out of Reset
Have button Zero DRO then tell you to pute Mach Into Reset via message box.
Press Reset button and Press Ok to previous box and now another message box says place tool in setter and press Reset which takes Mach Back Out of Rest.
When you do that and press Ok then the code will then run and update the tool table and that is you finished that tool.
rinse and repeat for alll other tools but do not do the Zero stage as it has already been done.

Hood
« Last Edit: August 25, 2016, 07:56:17 AM by Hood »

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Tool Offset Macro...
« Reply #172 on: August 25, 2016, 08:26:46 AM »
This actually works pretty slick....

Code: [Select]
Sub Main()

Dim Response, Style, Tool, NewHeight

Style = 48
If GetOemLED(800) Then
  Response = MsgBox ("Mach In Reset, Enable And Start Again", Style, "Tool-Height Setting")
  End
End If

Style = 48
Response = MsgBox ("Ensure Toolsetter Is Empty And At Ref Position", Style, "Tool-Height Setting")

SetOEMDRO(803,0)  'zero the A axis DRO

Response = MsgBox ("Mach Will Now Go Into Reset, Place Tool In Setter, Press Reset To Continue When Ready", Style, "Tool-Height Setting")

DoOEMButton(1021)  'put mach into reset

While ismoving()
Wend

Tool = Question("Enter Tool Number For This Offset")

DoOemButton(121)  'show the tooltabl

NewHeight = GetOEMDRO(803)  'Get the result

Code "G90" & "G10" & "L1" & "P" & Tool &"Z" & NewHeight

Style = 64
Response = MsgBox ("Tool No." & Tool & " Height Set", Style, "Tool Height Setting")

End Sub           

As soon as you put Mach back into reset it continues running the script and asks for the tool number :)

Better than I imagined it would work.

Just want on the belt to arrive now :)
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline rcaffin

*
  •  1,003 1,003
    • View Profile
Re: Tool Offset Macro...
« Reply #173 on: August 25, 2016, 08:27:55 AM »
I don't know the hardware, BUT ...
Taking Mach into and out of Reset for this just seems like a totally wrong way of doing it.   ???

My 2c.
Cheers
Roger

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Tool Offset Macro...
« Reply #174 on: August 25, 2016, 08:31:26 AM »
I don't know the hardware, BUT ...
Taking Mach into and out of Reset for this just seems like a totally wrong way of doing it.   ???

My 2c.
Cheers
Roger


Well, yes, in an ideal world I would just splash the cash and buy the ENC module so i have live measurements BUT thats another £80+ I don't have yet.

This is a kludge, but its practically free and that to me makes it a good fix :)

Going in and out of reset does nothing as the servos don't care, if it was steppers then different story as home ref would be lost.
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives

Offline rcaffin

*
  •  1,003 1,003
    • View Profile
Re: Tool Offset Macro...
« Reply #175 on: August 25, 2016, 08:33:35 AM »
This is a kludge, but its practically free
Hard to argue there!

Cheers
Roger

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Tool Offset Macro...
« Reply #176 on: August 25, 2016, 08:41:19 AM »
:)

So if I understand correctly, when finished, I would measure the Haimer 3d Probe and set as maybe tool 1

Then measure the other tools as their own numbers,

When setting a job I would insert and select tool 1, find zero, zero the Z DRO then away we go with any tool number i want?
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 #177 on: August 25, 2016, 12:55:26 PM »
Roger,
 it doesn't matter too much going in/out of reset when using the CSMIO/IP-A controller as it will keep track of the motors encoders and will update Mach's DROs from that info.

If  servos via Step/Dir with no feedback to Mach then it would not be a good idea.


Dave,
 good it seems to be working.
Yes that is the routine although if  you have a repeatable position on the setter that you will ALWAYS use for the zero position, then you will only need to set the Haimer up once.
Also I prefer to set it to tool 100 as it will be unlikely for you to enter a T100 by mistake in CAM where T1 may be.

Also remember the G43H*
If set up as Stop Spindle and Wait for the tool change it may do it automatically, not sure.

Once you have it running safest is to test each tool out before you go just in case something is not quite right. Once you have confirmed that it is working then you can be quite happy about trusting things in the future.


Hood

Offline Davek0974

*
  •  2,577 2,577
    • View Profile
    • DD Metal Products Ltd
Re: Tool Offset Macro...
« Reply #178 on: August 25, 2016, 01:42:03 PM »
Yes, i have a repeatable zero position so measuring the Haimer should only be needed once unless i break a tip or take it out of its weldon holder.

I have been doing testing just by using the "current tool" DRO on the 2010 screen-set which seems to apply the offset when you press enter, the post processors all have the right Tx M06 and G43 Hx format so thats ok.

Will be thoroughly tested thats for sure ;)
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 #179 on: August 26, 2016, 05:37:39 AM »
One slight hiccup in the sequence....

You have to have Mach out of reset to initiate the setter macro, in this state the DRO is NOT updated BUT the values change invisibly so, when you are told to ensure the setter is at ref point, if you move it, when the macro runs it zero's the DRO and when it goes into reset to get the reading, any invisible movement is placed into the A DRO - making zero incorrect, plus you cant zero it as Mach is now in reset - catch 22

So, you have to ensure you do not move the setter before the sequence starts or you get an error in measurement.

Now, can the invisible encoder data be cleared or zero'd before it gets to the DRO? Clearly Mach is tracking encoder input somewhere, it just does not allow the user to see it when Mach is out of reset.

This action is correct and normal, its just my usage of the system is at odds with what i want :)
Bridgeport Mill, Mach3 V062, CSMIO-IP/A controller, AC Servo Drives