Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Davek0974 on July 27, 2016, 01:24:51 PM

Title: Tool Offset Macro...
Post by: Davek0974 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;)
Title: Re: Tool Offset Macro...
Post by: Davek0974 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?
Title: Re: Tool Offset Macro...
Post by: Davek0974 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 :)
Title: Re: Tool Offset Macro...
Post by: RICH 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
Title: Re: Tool Offset Macro...
Post by: Davek0974 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
Title: Re: Tool Offset Macro...
Post by: Hood 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
Title: Re: Tool Offset Macro...
Post by: rcaffin 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
Title: Re: Tool Offset Macro...
Post by: Davek0974 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.

Title: Re: Tool Offset Macro...
Post by: Davek0974 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.
Title: Re: Tool Offset Macro...
Post by: Hood 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
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 29, 2016, 03:56:52 AM
Lucky bugger ;)

currently £276 + vat and delivery

Would you say go for the HQ or the shorter Mini for a Bridgeport with its limited Z motion ?
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 29, 2016, 04:13:04 AM
much different than this from my usual tooling shop...

http://www.cutwel.co.uk/measuring-tools/small-tool-instruments/indicators/mahr-martest-3d-waterproof-touch-probe-802-nw-series-1

Title: Re: Tool Offset Macro...
Post by: rcaffin on July 29, 2016, 04:23:51 AM
Hi Dave

Ah, OK, for a mill.
I use metal holding jigs a lot, and they are all made (machined up) with reference edges. I use the reference edges for alignment when reloading the jigs.

Frankly, I find sensitive commercial touch probes to be a bit of a pain, so I use the el-cheapo method of a ground 6.00 m carbide rod and a ground bit of shim between the rod and the reference edge. I find I can zero an axis to about 5 micrometres this way fairly quickly. That's for the X & Y axes.
For the Z axis, I often do just the same: use a shim between the cutter and a ref surface on the job. Again, 5 micrometres is normal.

One day I may set up a static ZTO at the sde of the mill table. But to use one I first need to use a mounted Z-probe to determine the difference in height between the top of the ZTO and the top ref surface on the job. I am working on that. Again, I find commercial 3D touch probes too expensive for this, too fragile, or too sloppy, so i will have to do something else, with a 1D probe.

Cheers
Roger

Title: Re: Tool Offset Macro...
Post by: Hood on July 29, 2016, 04:39:08 AM
Dave, if I recall there is less than 10mm height difference between the mini and the HQ.

Regarding the Mahr one, it just looks like the usual Chinese suspects, maybe a bit better quality but  only one needle where the Haimers have two, so take of that what you will.
Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 29, 2016, 04:57:03 AM
Hood, back to your method but applying to my setup....

SO say i now have a 3d-taster, it's in a weldon toolholder and I'll call it T100 for fun.

I would then place the setter in the spindle and ref to my touch plate.

Then fit a new tool/holder and call it say T1, then probe my touch plate and take the distance as the offset?

No, i've lost the plot now :)

How does it work without the toolsetter?
Title: Re: Tool Offset Macro...
Post by: Hood on July 29, 2016, 05:09:57 AM
Ok without a tool setter like I have I think probably what you would do is.
First make sure M6T0 is called so that no offsets are present.
Put the taster in the spindle, bring down to the touch plate and press the Zero button on the screen, now this is not the work offset zero but a VB button that will zero the User DRO. So no offset called for the taster and it is basically like fully down position on my tool setter, in other words it is the reference point.

Next put a tool in, bring down to touch plate, press the Set Z button (it contains the above VB) and a box will pop up asking the tool  number, enter the number and press OK and the tool table opens for you to enter the name and then save.
Repeat for all other tools.

Here is a vid of the height setter working.
https://www.youtube.com/watch?v=-DAmcLo9IW4

Oh and saw a German place on eBay selling the Haimer a bit cheaper than WNT is now.
http://www.ebay.co.uk/itm/Haimer-Taster-3D-Universal-Schaft-20mm-IP67-/221919260831?hash=item33ab6b309f:g:B2MAAOSwo0JWHfhs

Hood
Title: Re: Tool Offset Macro...
Post by: Hood on July 29, 2016, 05:12:00 AM
Also once tools are set up then what you would do is call M6T0 or possibly G43H0 and then get the top of the material with the Haimer, press the Zero button at the side of the Z DRO to zero the work offsets, once you have done that then any tool/offset number called should be at the surface.

Hood
Title: Re: Tool Offset Macro...
Post by: Hood on July 29, 2016, 05:14:57 AM
Actually thinking a bit more about it, because you do not have the glass scale then I think the initial button would be the Z DRO zero and the code in the Set Z button would then look to that DRO for the offsets for the rest of the tools.
Typing this is jogging my memory and it is actually the way I used to do things before I make the tool setter for the Beaver Mill.

Hood
Title: Re: Tool Offset Macro...
Post by: Hood on July 29, 2016, 05:16:45 AM
Obviously this is all manual and requires you to jog via the MPG but as the CSMIO MPG jogging is so accurate and predictable compared to Machs normal method, it is no real hardship :)
Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 29, 2016, 05:23:51 AM
Ok without a tool setter like I have I think probably what you would do is.
First make sure M6T0 is called so that no offsets are present.
Put the taster in the spindle, bring down to the touch plate and press the Zero button on the screen, now this is not the work offset zero but a VB button that will zero the User DRO.

Hmm, so is that "user" DRO a new one i need to add? or the Z axis DRO?

I'm on the 2010 screen-set so adding pretty much anything is buggered as there is no space really, I could, maybe squeeze a small button in.

I have a Haimer HQ on order, got a small discount as it was my first order so thats something.

Gonna need a lot of coffee to get this into my cranium i think.
Title: Re: Tool Offset Macro...
Post by: Hood on July 29, 2016, 05:24:10 AM
Ah yes memories flooding back now, I used to use a home made probe for the Z touch off \(and edge finding) before I made the setter and the DRO was the normal work offsets Z DRO.
Just looked for the probe I made, not used it for a long time, here it is .
https://youtu.be/zsspbAu9bZE

Hood
Title: Re: Tool Offset Macro...
Post by: Hood on July 29, 2016, 05:25:36 AM
It is the normal Z DRO I think, memories coming back to how I originally did it and I had the VB in a button looking at the Z DRO. So you would have to add a button but no DRO.
Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 29, 2016, 05:26:25 AM
Obviously this is all manual and requires you to jog via the MPG but as the CSMIO MPG jogging is so accurate and predictable compared to Machs normal method, it is no real hardship :)
Hood

Ah, i was looking at using a probing routine of some sort, if doing it manual, how would i know the tool is at a repeatable zero? The difference between 0 and -0.1 or -0.2mm in "feel" is bugger all really until it comes to a cut ;)

Title: Re: Tool Offset Macro...
Post by: Hood on July 29, 2016, 05:29:10 AM
Well I suppose you could use a probing routine, just I did it manually. However if you had a LED connected to the plate then it would be very accurate and you can set the IP-A to jog at 0.001mm if you want :)

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 29, 2016, 05:37:33 AM
Ah so a modified 'set tool' button with your code at the end and a simple probe routine at the start sounds possible - why jog when you can probe :)

No need to take the touch-plate thickness into account as the 3d-taster will be referenced to to that anyway.

I have a vision now, a bit cloudy still but clearing.....
Title: Re: Tool Offset Macro...
Post by: Hood on July 29, 2016, 05:40:44 AM
The code would have to be modified to look at the Z DRO rather than the user DRO or maybe even would have to look atthe variables, depends how your probing macro works.

As said I do all the setting off the machine so no jogging required for me  except for the actual top of material with the Haimer.
Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 29, 2016, 05:53:32 AM
Is that the Z machine DRO?

I guess so.

I'll have a look at some code and see what can be done.

train of thought.....

Place 3d probe and ref it then zero the work DRO.

the setting routine would first copy the machine DRO to a #var
probe fast,
probe slow,
the point when it hits the plate for the slow probe would then read the machine DRO and compare to the first stored reading - the difference would then be passed to the VB code to store it?
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 29, 2016, 06:22:20 AM
Ok, a little more thought....

Place 3d probe and ref it, no need to zero anything.

Press the 'set tool' button...
the setting routine would first copy the current machine DRO to a #var
move Z in machine co-ords to Zero so that drawbar can be undone and new tool fitted,
probe fast,
probe slow (more accurate),
at the point when it hits the plate for the slow probe it would then read the machine DRO and compare to the first stored reading - the difference would then be passed to the VB code to store it in the tool table
Title: Re: Tool Offset Macro...
Post by: Hood on July 29, 2016, 07:01:10 AM
Yes that sounds like it may work, I just used machine coords DRO but as said that was manually touching off per tool.
I think it doesnt really matter where you take the reference from whether machine or work coords  or for that matter some arbitrary DRO value like with my tool setter. The important thing is it is all from a repeatable position, as said I use the Machine zero for X and Z on my lathe as the reference point as that is very accurate being Index homing and never changes.
Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 29, 2016, 08:52:23 AM
Ok, on paper at least, I think this macro will work ;) ...

Ref machine,
Place 3-taster in spindle,
Place touch-plate,
Jog Z to zero on plate,
Press macro start button or MDI it

User is asked if they want to store the new reference offset (this bit needs automating somehow)
If yes then current Z machine DRO is stored in var

then z raises to zero so drawbar can be released

user prompted to fit first tool

height is probed

difference in new z machine DRO and reference one calculated and passed to code for storage in tool table as per Hoods' idea (nice)

rinse and repeat



Code: [Select]
Sub Main()
' Tool Height Offset Measuring
' Based on the macros created be Big Tex -  May 25 2010
' and modified by D. Kearley 29 July 2017 with help from Hood via Mach3 forum
' Machine Z should be set with 3d Height Probe first to top of touch-plate

Dim ZNew, ZMachineEnd
Dim ClearAllow, NewOffSet

If GetOemLED(800) Then
  MsgBox ("Mach In Reset, Enable And Start Again")
  End
End If

If MsgBox ("Reset Reference Tool Offset?", 260, "Master Reset")=6 Then
  SetVar(500, GetOEMDRO(85))   ' Get Current Z Machine Coordinate at first pass of routine - this was set manually with 3d-Taster
End If

' Move the Z axis up so 3d-taster can be replaced with a tool
Code "G0 G53 Z0" 'move in machine coordinates to Z zero

MsgBox "Please Mount First Tool In Spindle"

'//////// the block below will set all your reusable vars depending on Inch or mm.
'//////// this sets the vars so you only need ONE large block of probing code.

If GetOEMLED(801) Then  ' On = English Measure INCH
  FirstProbeDist = 6.0 ' Probe down 6 inches
  FirstRetractDist = 0.05 ' Then retract .05 inch
  SecProbeDist = 0.25 ' Then probe down .25 inches
  FirstProbeFeed = 10.0 ' First probe feed @ 10 ipm
  SecondProbeFeed = 1.0 ' Second probe feed @ 1 ipm
  ClearAllow = 0.125 ' Max Allowable Clearance = Z Machine Zero - .125in
Else ' Off = Metric Measure MM
  FirstProbeDist = 150.0 ' Probe down 150mm
  FirstRetractDist = 1.0 ' Then retract 1mm
  SecProbeDist = 6.0 ' Then probe down 6mm
  FirstProbeFeed = 250.0 ' First probe feed @ 250 mm/min
  SecondProbeFeed = 25.0 ' Second probe feed @ 25 mm/min
  ClearAllow = 2.0 ' Max Allowable Clearance = Z Machine Zero - 2mm
End If

'//////// Error Condition checking...

If GetOemLED(16)<>0 Then ' Check for Machine Coordinates
  Code "(Please change to working coordinates)"
  Exit Sub ' Exit if in Machine Coordinates
End If

If GetOemLED(825)<>0 Then
  Code "(Touch-Plate Is Grounded Check connection and try again)"
  Exit Sub ' Exit if probe is tripped
End If

'//////// Start Probing Code, Probe In -Z direction.
'//////// The vars will be Inch or Metric from above if/else statment

MsgBox "Touch-plate should be in position" ' Get user to check probe plate

Code "F" & FirstProbeFeed ' Set feedrate to 10 ipm or 300mm/min
Code "(Probing for Z Zero.....)" ' Puts this message in the status bar
ZNew = (GetOEMDro(802) - FirstProbeDist ) ' Probe move to current Z - 6 inches
Code "G90 G31 Z" & Znew
  While IsMoving() ' Wait for probe move to finish
  Wend
ZNew = GetVar(2002) ' Read the touch point
Code "G0 Z" & ( ZNew + FirstRetractDist ) ' Move up .05 inch or 1mm in case of overshoot
  While IsMoving()
  Wend

Code "F" & SecondProbeFeed ' Set feedrate to 1 ipm or 25mm/min
ZNew = (GetOEMDro(802) - SecProbeDist ) ' Probe move to current Z - .25 inches
Code "G90 G31 Z" & Znew
  While IsMoving()
  Wend
ZNew = GetVar(2002) ' Read the touch point
ZMachineEnd = GetVar(2002) 'store the final machine co-ordinate

Code "G0 G53 Z0" 'Fully Retract the Z ready for next tool
While IsMoving()
Wend

NewOffset = GetVar(500) - ZMachineEnd 'calculate the result

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

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

DoOemButton(121)  'show the tool table

End Sub    

What we reckon ?? :)

Will have a play with it tonight on the machine just to see what happens.
Title: Re: Tool Offset Macro...
Post by: RICH on July 29, 2016, 08:53:30 AM
Quote
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

A few comments first:
- When machine coordinates = part coordinates then there are no offsets
- One can create an inialization file / macro to put the machine into a reapeatable state
- One can reference or de-reference axes
- Lathe tooling is more complex than mill tooling,so there are differences, but basics of
  how to are still similar.
- Tool 0 has no offsets, is not configurable but can be used to advantage
  ie; T#0 and T#1 can be used for the master tool but if you change T#1 then all the other
  tool offsets get changed. All tools relate to the master but they also relate to each
  other.
- Any touch off and recording of data is only as accurate / repeatable as YOUR machine
  and setup.

---------------------------------------------------------------------------------------
  
Now there are numerous ways to do things, but here are some things to think about which
in the long run will save you time.

1.How do YOU want to work?
2.How automated and to what extent do you want to do things.....now and in the future?
3.If you can get a a screen set which satisfies your needs, buy it / use it as custom
  stuff does take time to do.
4.No need to buy expensive stuff when you can accomplish the same simply and accurately
  with home brew things. BUT, there is a lot to be learned by reviewing what industry has to
  offer and how it's done.
----------------------------------------------------------------------------------------

Simplified example:

Home, referenced location, and tool change location are the same based on a probed
part location or setter using reference tool / Tool #0. KISS! Tool#1 is also the same
reference / master tool and has no offsets.Thus one can see current tool offset in the DRO's.
There are no G92 offsets. Thus any tool offset is based is based on machine move as compared
to the master tool for current probed tool to same location.The axis is probed to a common
surface / plane and touched off automaticaly and also the the current tool offset is put into
the tool table. Moving away to a generic / common location is always known.

SO.....Set / find a reference, probe axis to it, move away for change tool, probe current tool
and continue until tool table is populated.

NOTE:
Not all needs to be as above initial current state, BUT, It all depends on how you want to work.
ie; You could have the tool change location anywhere you want,etc,etc, etc.
What YOUR macro does addresses YOUR machine capabilities, how YOU want to do stuff.

-------------------------------------------------------------------------------------------

So it would seem logical that one look at the big picture and probing macro would find
some location, set/ reset machine state, find and update the tool table. But addtionaly
one may want additonal options like:

TOOL TABLE
- open it
- save it
- export it
- reset it
- import a table

Allow for manual and automated offset adjustment, tool change location, creation changing
of offsets, etc.

But other then tool probing, probing can be used to find locations, create a dxf based on
point data, and all the variations on data manipulation to suite ones need.

Just some thoughts,

RICH
 
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 29, 2016, 01:47:26 PM
Well, I thought i was getting somewhere but....

The new macro works really well at populating the offset list.

Then, I thought i'd get smart and test it so i measured up three tools, put tool 1 in the current tool box (2010 screen set), mounted tool 1 and being a bit nervy I put something a little soft between the touch-plate and the vise.

Next, I presumed i would simply do an auto-probe in the normal way to ref the part surface and that would allow the tool offsets to all be relevant to to my imaginary work surface.

So, plate in position, push ref-z and tool comes down, touches off, lifts, comes down slower, touches off then, much to my disbelief it piles into the work surface seemingly at 50,000mm/min !

The ensuing collision smashed the link between the z screw nut and the spindle and didn't even bother the servo - some power there!.

SO.... I have stripped the Z axis down again, turns out the original bridgeport part i tried welding to was cast iron - that explains the poor weld and oil porosity.

Sheared off where the counter-bore for the big hex-head screw ended - casting was only about 2mm thick at that point.

Anyways, instead of spending the weekend building the control cabinet, it looks like i need to spend it making a new Z coupling with just a lathe :(

No idea what i did wrong either.

Bugger.

Title: Re: Tool Offset Macro...
Post by: Hood on July 29, 2016, 04:21:19 PM
Not so good, it is also one of the reasons I would be very wary of automating any process with the Haimer ;)
Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 29, 2016, 04:31:00 PM
The Haimer part of the process is fully manual so should be safe ;)

I really can't figure out what happened or why, yet.

The standard probing was working fine before.
The new macro worked beautifully, the figures in the tool table look believable,
I always test the touch-plate each time and it did read it ok twice so its not that,

Just when i run one after the other it probed ok but then plunged the Z hard and fast about 1"

When i've fixed her i'll be doing some testing in a safe fashion, maybe leave the belt off the axis drive or test with it close to Z- limits.

Bloody annoying though,
Title: Re: Tool Offset Macro...
Post by: Hood on July 30, 2016, 03:53:10 AM
Ah ok, was a bit worried when I read earlier and thought you were automating it all and I could see in my minds eye a smashed up Haimer :D

BTW did you order a spare probe with it? You will likely need one soon enough, it is very easy to just move it the wrong way and see it snap :D

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 30, 2016, 04:59:46 AM
Not yet, short on cash so will just have to treat it like glass ;)

Once i've rebuilt the Z axis, i'll have to do some serious testing in a safe way to try and figure out what happened.
Title: Re: Tool Offset Macro...
Post by: Hood on July 30, 2016, 05:52:50 AM
Not yet, short on cash.....

Sounds familiar, hence no progress on plasma :D Also short of time at the moment.

Everyone is desperate to get their jobs done but are not as desperate to pay their bills :D

Hood
Title: Re: Tool Offset Macro...
Post by: rcaffin on July 30, 2016, 06:13:23 AM
A bit of 3mm (1/8") PVC welding rod makes a good dummy for this sort of thing. Just thread one end. They are surprisingly good in fact.
Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 30, 2016, 06:59:50 AM
Started reassembling the Z drive now, there is no way this adaptor will break, next crash would be a bitch i think.

I reckon the first tests will be done with nothing in the spindle at all;)
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 30, 2016, 10:06:04 AM
OK, she's up and running again :)

Might have figured out what happened but need some help to verify it please.....

Calculating a tool offset.

I have placed a 3d height probe in my spindle and set the Z axis to a known offset from Machine zero lets say Z= -50mm

I then place Tool number 1 in the spindle and do a straight G31 probe, lets say the result read from Var2002 is Z= -30mm (so T1 is longer than the height probe)

What should the tool-table entry be here??

Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 30, 2016, 12:15:57 PM
Right, stuff learnt :)

By trial and error I got the math right for tool offsets :)

Made up some sacrificial tools from 2mm ally Tig rods, master ref tool was longest and rest got shorter by random amounts around 10-12mm each

Put master tool (eventually my Haimer probe) in the drill chuck (easy for messing about) and set it manually onto my touch-plate.

Ran my setting macro and stored the master offset, then fitted tool 1 and allowed the macro to auto-probe, then set that as tool 1 in the tool-table.

Rinse and repeat the last step up to tool number 4

Move the knee a bit, put tool zero (ref tool) in the Current Tool box, manually ref the work (top of vise) and set Z zero

Change to tool 2, enter tool 2 in current tool box, MDI'd G0 Z0 and it went exactly where it should,

Repeat the last step with all tools and all went to the exact spot (top of material) - things were looking up, i could now use my four tools without re-refing the surface.


OK, what i did wrong which trashed my Z axis....

I had put tool 1 in the machine and entered tool 1 in the current tool box but then ran an auto-probe routine on the surface, expecting it to just set that tool as Z0 and then be able to carry on as normal with other tools.

I did it again and only sacrificed 6" of Tig rod this time, what happens is this....

Tool comes down at fast probe speed,
Touches off the plate,
Tool lifts 2mm,
Tool then plunges rapidly downwards.

So for some reason it seems you cannot use the 2010 screen simple probe macro with tool length offsets applied????

Scary stuff - so easy to trash things.

Is this normal or total operator failure??

Maybe i should block that macro running if tool number is >0 ??
Title: Re: Tool Offset Macro...
Post by: Hood on July 30, 2016, 04:02:16 PM
You would probably have to ask Gerry what his macro does, assuming you can not see it.
Think I would look at the M31 macro and adapt it if wanting to use the probing cycle.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 30, 2016, 04:05:46 PM
Nah, its all accessible - buttons just call macros.

It was the same macro i hacked to bits to create my tool setting routine;)

ill have another look - the crash happens between the first pass and the second so should be easy to read.
Title: Re: Tool Offset Macro...
Post by: Davek0974 on July 31, 2016, 10:32:54 AM
Just a couple of pics of the busted Z axis coupler and the replacement, I had no idea the original part was cast iron!

New one should be a fair bit stronger.
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 14, 2016, 10:30:23 AM
Hmm, i thought I had this working, seems not.

My routine seems to be coming up with odd results, here's the setup...

Ref tool = 126mm long approx
T1 = 145mm long approx

With ref tool in and zeroed at touch-plate surface manually, Machine Z = -66.7062
With T1 in and run to the touch-plate manually, Machine Z = -45.9865
So my length difference = 20.7187mm

I *think* the tool table should show 20.7187 (positive because T1 length > Ref Tool)

BUT

What it's showing is 25.970250 - totally wrong and off by some 5mm.

Anyone care to whale in and offer some help here?
Macro for height setting is below.


Sub Main()
' Tool Height Offset Measuring
' Based on the macros created be Big Tex -  May 25 2010
' and modified by D. Kearley 29 July 2017 with help from Hood and others on the Mach3 forum
' Machine Z should be set manually with 3d Height Probe first to top of touch-plate

Dim ZNew, ZMachineEnd
Dim ClearAllow, NewOffSet
Dim Response, Style

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

Style = 48
If GetOemDRO(42) > 0 Then
  Response = MsgBox ("Please Use A Zero Offset Length Tool For This Routine", Style, "Tool-Height Setting")
  End
End If

Style = 3 + 32 + 256
Response = MsgBox ("Reset Reference Tool Offset?", Style, "Tool-Height Setting")
If response = 6 Then 'user pressed yes
  SetVar(500, GetOEMDRO(85))   ' Get Current Z Machine Coordinate at first pass of routine - this was set manually with 3d-Taster
End If
If Response = 2 Then 'user pressed cancel
  End
End If

' Move the Z axis up so 3d-taster can be replaced with a tool
Code "G0 G53 Z0" 'move in machine coordinates to Z zero

Style = 64
Response = MsgBox ("Please Mount First Tool In Spindle", Style, "Tool-Height Setting")

'//////// the block below will set all your reusable vars depending on Inch or mm.
'//////// this sets the vars so you only need ONE large block of probing code.

If GetOEMLED(801) Then  ' On = English Measure INCH
  FirstProbeDist = 6.0 ' Probe down 6 inches
  FirstRetractDist = 0.05 ' Then retract .05 inch
  SecProbeDist = 0.25 ' Then probe down .25 inches
  FirstProbeFeed = 10.0 ' First probe feed @ 10 ipm
  SecondProbeFeed = 1.0 ' Second probe feed @ 1 ipm
  ClearAllow = 0.125 ' Max Allowable Clearance = Z Machine Zero - .125in
Else ' Off = Metric Measure MM
  FirstProbeDist = 150.0 ' Probe down 150mm
  FirstRetractDist = 1.0 ' Then retract 1mm
  SecProbeDist = 6.0 ' Then probe down 6mm
  FirstProbeFeed = 250.0 ' First probe feed @ 250 mm/min
  SecondProbeFeed = 25.0 ' Second probe feed @ 25 mm/min
  ClearAllow = 2.0 ' Max Allowable Clearance = Z Machine Zero - 2mm
End If

'//////// Error Condition checking...

If GetOemLED(16)<>0 Then ' Check for Machine Coordinates
  Style = 48
  Response = MsgBox ("Please Change To Working Coordinates", Style, "Tool-Height Setting")
  Exit Sub ' Exit if in Machine Coordinates
End If

If GetOemLED(825)<>0 Then
  Style = 48
  Response = MsgBox ("Touch-Plate Is Grounded, Check Connection And Try Again)", Style, "Tool-Height Setting")
  Exit Sub ' Exit if probe is tripped
End If

'//////// Start Probing Code, Probe In -Z direction.
'//////// The vars will be Inch or Metric from above if/else statment

Style = 64
Response = MsgBox ("Ensure Touch-plate Is In Position", Style, "Tool-Height Setting") ' Get user to check probe plate

Code "F" & FirstProbeFeed ' Set feedrate to 10 ipm or 300mm/min
Code "(Probing for Z Zero.....)" ' Puts this message in the status bar
ZNew = (GetOEMDro(802) - FirstProbeDist ) ' Probe move to current Z - 6 inches
Code "G90 G31 Z" & Znew
  While IsMoving() ' Wait for probe move to finish
  Wend
ZNew = GetVar(2002) ' Read the touch point
Code "G0 Z" & ( ZNew + FirstRetractDist ) ' Move up .05 inch or 1mm in case of overshoot
  While IsMoving()
  Wend

  Code "F" & SecondProbeFeed ' Set feedrate to 1 ipm or 25mm/min
ZNew = (GetOEMDro(802) - SecProbeDist ) ' Probe move to current Z - .25 inches
Code "G90 G31 Z" & Znew
  While IsMoving()
  Wend
ZNew = GetVar(2002) ' Read the touch point
ZMachineEnd = GetVar(2002) 'store the final machine co-ordinate

Code "G0 G53 Z0" 'Fully Retract the Z ready for next tool
While IsMoving()
Wend

NewOffset = ZMachineEnd - GetVar(500)'calculate the result

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

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

DoOemButton(121)  'show the tooltable


End Sub                
Title: Re: Tool Offset Macro...
Post by: Hood on August 14, 2016, 10:39:11 AM
Maybe there is a reason CS-Lab have given the option of M31 rather than G31.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 14, 2016, 10:59:18 AM
Just been looking at that, Does not make sense yet, seems the M32 part just gets some parameters which are passed to an internal plugin code, it does not say where or how the output is given? It says you can modify it but looks like only the parameter part is accessible?

I need to figure out whats going on in my G31 code i think.

From the CS-Labs site...

"As you all know Mach3 software has G31 function for probing. Using this function we can do precise tool length measurement or determine a location of an edge of our workpiece on a work table."

So it seems G31 should work ok.
Title: Re: Tool Offset Macro...
Post by: Hood on August 14, 2016, 11:20:41 AM
I think the M31 only writes to Vars or something and it is just a base file for you to add to.
I see they al;so have a Tool Length macro which uses G31, it is in this zip.
http://www.cs-lab.eu/en/upload/macra/macro.zip

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 14, 2016, 11:54:27 AM
Been testing again, fixed one thing, found another :(

The error was caused by my pressing "Apply" when it shows the tool table, if you only press "OK" then it all works fine, no idea why, when it auto-loads the tool table the new value does not show either.

Anyways, after figuring that out I tried it again and this time it plunged the Z down again like it did when it crashed :( It seems it works then something gets upset and thats it - crash time.

It probes fine at rapid, then hits the plate, then plunges when it should lift and probe slowly. It only plunges at hyper speed for a short distance - about 10mm it appears then it slows to correct very slow speed.

So, as i cannot trust it now, that means i can't use probing to populate the tool table. :(

I guess I need a calculator and pencil and paper then - not impressed.
Title: Re: Tool Offset Macro...
Post by: Hood on August 14, 2016, 12:58:53 PM
Never used tool height setting via Mach so can't help much.
May be an idea to contact CS-Lab and attach the macro and see if they can help.
I did modify the M31 macro for the plasma and it seems to work ok but only done a small amount of testing as the plasma is not finished yet.
Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 14, 2016, 01:14:39 PM
It seems to be a DRO update thing maybe, I might play with it some more when i get a chance, else its out with the calculator I guess.

I might remove the auto-load for the tool-table line, it does not show the new values for some reason but does if you manually load it??

I will also contact CS-Labs as mentioned.
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 14, 2016, 05:54:00 PM
Hi Dave
You may have mentioned it somewhere, but I haven't found it.
What version of Mach3 are you using, and are you using an ESS? If so, what firmware version for the ESS?

The reason I ask is that I KNOW, from personal experience, that some versions did not handle probing properly. Strange values got returned in the 200n variables at times, and other oddities. A few 'bumps' were experienced.

However, having updated to .062 and ESS u4f1a (weird, but I think that's right) I can now do probing with sub-micron resolution for thousands of cycles on end. I am even game to walk away while it is running!

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 15, 2016, 02:12:06 AM
I think its on .066 but will have to check that on the setup, I am using the CS-Labs CSMIO-IP/A controller.

Title: Re: Tool Offset Macro...
Post by: rcaffin on August 15, 2016, 02:18:24 AM
Ah. I have never used .066, but I have been warned against using it. Apparently it has many bugs. The normal recommendation from experienced users is .062. I would seriously suggest you consider changing to .062 and retesting.

I don't know the CS-Labs CSIO gear either.

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 15, 2016, 04:45:46 AM
Ok will get 062 and try that,

I have had some success, it seems it may be possibly my fault, it crashes if the tool selected is NOT tool 0 or a zero-length tool, i.e. it will plunge if tool-length offset > 0.

Now, it was seemingly random because most of my tool table is empty, i am only messing with tools 1-4, zero is my Haimer probe or general purpose tool.

Then it seems that i had fixed this and put a bit of code in to stop it running if tool >0 BUT it is not reading this code so it let me run it anyway hence the crashes.

It looks at OemDro(42) tool Z offset which i thought was right but it seems I should try OemDro(32) tool length offset??

Or maybe look at OemDro(824) tool number???

I think the issue was likely my error but also the wrong code to block my error
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 15, 2016, 05:42:04 AM
A double error? Those are the good ones!
I do use the tool table, but so far only for the gang tooling on the lathe. It works great there.
I am using a good BT30 to ER25 adapter on the mill, and for now I am happy changing tools and collets by hand - and rezeroing the Z axis during this.

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Hood on August 15, 2016, 06:00:58 AM
Junk 066 whether it is te issue or not as it has lots of other nice things in it that will bite you ;0

Ok I am trying to remember how I did it before I had the tool height setter, whether it will help or not I don't know.

I think what I did was called my probe T244 or something and called that tool with the relevant offset and then touched off the surface of the part and zeroed the  DRO, or maybe even just called M6T0 and G43H0 rather than having it set as a specific tool, shouldn't matter either way, the important think I think is touching off the material and setting the Z DRO to zero.
 I then loaded another tool up but didn't change the tool number or offset at this stage. I then brought that down to touch off the material and then pressed my Tool Set button. That button looked at the  Z DRO  and the value in there was the difference between the probe and the new tool, The script in the button popped up the box asking what tool number I wanted (actually offset number in reality) and I entered that into the box and pressed ok, the script then read the Z Dro and entered that into the tool table and that was the tool set. I then repeated for the other tools, always making sure the original height offset was kept the same.

Now as said this is only what I THINK I did, it was probably 8 or so years ago so memory is sketchy.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 15, 2016, 07:34:57 AM
Ok, will be looking at this again before expensive tooling goes in ;)

Where do i find the good version for download?
Title: Re: Tool Offset Macro...
Post by: Hood on August 15, 2016, 07:44:15 AM
ftp://ftp.machsupport.com/Mach3/ (ftp://ftp.machsupport.com/Mach3/)


Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 15, 2016, 09:42:49 AM
ftp://ftp.machsupport.com/Mach3/ (ftp://ftp.machsupport.com/Mach3/)




needs password??
Title: Re: Tool Offset Macro...
Post by: Hood on August 15, 2016, 12:02:49 PM
Nope, shouldn't do, did you wait, it sometimes takes a while.
Direct link here if still no joy.
ftp://ftp.machsupport.com/Mach3/Mach3Version3.043.062.exe (ftp://ftp.machsupport.com/Mach3/Mach3Version3.043.062.exe)

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 15, 2016, 02:25:21 PM
Got it, thanks Hood,

As i have a custom screen-set and many custom macros, is there a "pain-free" path to do the update on Mach??

Really don't want to upset things at this stage ;)
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 15, 2016, 05:07:11 PM
You will need to do a backup of your screen sets and macros, to somewhere else. But you DO have secure backups of all your stuff, DON'T YOU?

I use SecondCopy to do automated nightly backups of any changed files from C: to a different device. For my desk PC the backup target is a whole new 8 GByte drive; for the CNC PC the backup is an external 8 GByte USB key plugged in at the back. If C: crashes the backups with ALL my files and programs and data are still there.

After the update, you will need to restore the screen sets and macros to where they came from. I think that's about all that's essential, but maybe there are other things you will want to backup as well.

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Hood on August 15, 2016, 06:44:38 PM
Best to always have a backup on another drive or an external drive like Roger said.
What I also often do before a re-install is copy the whole Mach3 folder to a different location, desktop or whatever then I can safely do the install.
If you have a custom profile then it should go without a hitch, just install the older version over the top of the present one and you should be fine.
If you do not have a custom profile then you will need to copy back all of your custom files after the install.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 16, 2016, 02:16:25 AM
Do you need to reinstall the CSMIO software too??

Yes i always keep a copy of the main Mach folder on a USB stick ;)
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 16, 2016, 02:22:29 AM
Do you need to reinstall the CSMIO software too??
That I do not know. You would need to check the doco.
Certainly, you will need to tell Mach that you want to use it.

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Hood on August 16, 2016, 02:35:52 AM
No, you shouldn't need to unless you delete the Mach folder contents before installing.
If you have a custom profile then you will not need to do anything at all, just open Mach and everything will be exactly as before.
If you used a default profile then you will need to overwrite the xml and macros with your saved copies and then once done  you will be back to your previous state and  again nothing requiring setup.,

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 16, 2016, 03:57:54 AM
Ok, thanks thats a job for tonight ;)
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 16, 2016, 07:45:06 AM
I think I have sussed out what goes on, and yes it was my fault really, probably;)

It's this little block here, especially the last two lines.

Unknowingly I was probing with a tool-length offset applied, it seems that when Mach did the sums for the retract distance, it applied the offset and instead of coming up with a Z figure of 1mm ABOVE where it was and doing a G0 UPWARDS, it came up with a figure that was 1mm - the offset value and did a G0 DOWNWARDS, mashing the tool into whatever by anything from a mm to many mm in Z- direction depending on the offset.

I have now block all probing if anything but tool zero is chosen, that should safety things up a bit i think.

Code: [Select]
Code "F" & FirstProbeFeed ' Set feedrate to 10 ipm or 300mm/min
Code "(Probing for Z Zero.....)" ' Puts this message in the status bar
ZNew = (GetOEMDro(802) - FirstProbeDist ) ' Probe move to current Z - 6 inches
Code "G90 G31 Z" & Znew
  While IsMoving() ' Wait for probe move to finish
  Wend
ZNew = GetVar(2002) ' Read the touch point
Code "G0 Z" & ( ZNew + FirstRetractDist ) ' Move up .05 inch or 1mm in case of overshoot

Do you guys concur here?

I like to know why sh1t happens ;)

Title: Re: Tool Offset Macro...
Post by: rcaffin on August 16, 2016, 08:19:47 AM
Tool 0 always has zero offset. OK.
Tool 1 has a 2 mm offset. But using it causes the probe to crash downwards. Hum ...
Are you sure you have the sign right? Just wondering.

Seems to me a few experiments with probing a mid-air paddle pop stick might be illuminating. Provided the paddle pop stick breaks first.

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 16, 2016, 09:18:40 AM
I have been testing this to death since my crash, I use tools made from Tig rods :)

tool offsets are negative if the tool is shorter than the main ref device, positive if longer.

I have only tried negative offsets as that is what is needed, its just the math for the Z when running that piece of code gives a negative so the Z tries to plug rather than lift as it should.

It works perfectly if no offset applied.

If i follow the steps carefully, it works perfectly as i would expect it to :-

Find the surface with the surface probe as tool zero, then select a tool, set the tool number and away you go.

Just DON'T do an auto G31 tool probe with an offset applied.

I've blocked it now so i should be safer, but is the logic here correct in my last reply??
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 16, 2016, 02:16:09 PM
Upgrade done, nice and easy too ;)

Now running .062

Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 17, 2016, 05:31:32 AM
Just had a reply from CS-Labs re the probing crash, It seems i am correct that probing must be done with tool zero or a tool with NO offset entry - they sent me a macro and it will only run on tool zero - just as mine does now.

That explains the crashing then :)
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 17, 2016, 07:20:15 AM
Hi Dave

Well, most interesting information. I will remember that. Thank you.

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 17, 2016, 07:21:55 AM
Its just the math - having an offset gives a result for Z that can change a small upward lift to a large downward plunge.
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 17, 2016, 07:45:36 AM
And a snapped stylus ...
 :-[
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 17, 2016, 08:11:01 AM
If it was a large offset, it can be worse, when i first had it happen it ripped the Z-drive apart on my conversion project, luckily the part that broke was cast iron, it's steel now so a future crash would be far worse, even a 400w ac servo and 2:1 drive has a frightening amount of power in it.
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 17, 2016, 05:31:41 PM
I have a current limit on the (DC brushed motor) servo drivers and a fast magnetic circuit breaker on the supply to each servo driver. There have been times when I have had to reset the breaker on an axis. Beats the hell out of rebuilding the mechanics though. A small W28-XQ1A-5 breaker by Potter & Brumfield.

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Hood on August 17, 2016, 06:36:14 PM
AC Servo drives normally have  an option to set a max current.
However I think the problem with the Z Axis on a manual Bridgeport is there is no real way to make the connection to the quill strong and if the bracket is fairly sturdy  then there is a danger of destroying the thread in the quill.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 18, 2016, 02:12:33 AM
Yes, that quill connection is a real weak spot. It places a lot of twisting action on the ballscrew nut as well. There probably is a current limit option but the manuals are a bit scary Chinglish at best.
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 18, 2016, 01:45:42 PM
Well, I have no idea of what I am doing wrong or what is going on here but i have bugger all trust in the tool-table at the moment :(

I wanted to modify a vise jaw tonight, just a simple half-round groove and the first job on the mill. Thinking I might do it properly from the start, i set my z zero with the Haimer, run the tool setting macro as before, inserted the ball-nosed tool and its holder, finished the setting routine, gave it a name etc.

Then I thought it best to double-check so i set the Z zero on the workpiece using the Haimer, inserted the tool, entered tool 1 in the current tool box on screen, inched it down to Z zero and f*&k me if it wasn't a good 25-30mm high :(

Tool table showed something like -16mm for that tool.

I run the job using manual Z setting with a slip of paper under the tool.

Then i re-run the set routine on another tool number(same tool) and the tool table showed something like +36mm and the tool ended up even further above the work.

SO, either I am being a twat, or something is wrong in the world here?????

The code i am running is the same as CS-LABS code and the same as many other G31 probing routines.

Any ideas at all, i really want the tool table as I have splashed a lot of cash on tool-holders specifically so i can set the Z once per job and then switch tools easily.
Title: Re: Tool Offset Macro...
Post by: Hood on August 18, 2016, 06:05:23 PM
I presume you are calling the height offset? G43H***

Hood
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 18, 2016, 06:12:28 PM
I don't think it is the tool table itself which is the problem. I use gang tooling on the lathe: it is a bit of a pain to set it up but then it works very reliably. One outside tool, one boring bar, one drill bit and one parting-off tool. Swap between them with T0n0n all the time. That manages to hold a few microns in production runs.

However, that is on the lathe. I have not used the tool table (yet) on the mill. As I use an ER25 collet and the tools don't have stops on them, I probably can't either. I will have to to use a ZTO instead, so I hope it works! Just use tool 0 and tweak the zero.

About all I can suggest is some mindlessly simple testing. Clear the whole tool table to zero, then cycle through 5 tool numbers and see what happens as you probe with each tool number. I find trying to take big steps usually results in them being into an abyss.

Cheers
Roger
PS: I think it will all work in the end - once all the unknown, unstated, and unsuspected assumptions/errors have all been sorted out.
Title: Re: Tool Offset Macro...
Post by: Hood on August 18, 2016, 07:02:47 PM
I use the tool table every single time I use the Chiron, have at least 40 tools set up in it, adding and overwriting as I replace broken or worn tools and never an issue so it must be the way the auto routine is doing things rather than the table itself.

Hood
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 18, 2016, 07:11:48 PM
so it must be the way the auto routine is doing things rather than the table itself.
Reckon.  I rarely trust someone else's code. (Voice of 50+ years of programming experience there.)
Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 02:32:28 AM
Hmmm, i don't doubt the table really, its just a table after all, more a case of garbage in, garbage out.

When i change tools, i am doing it manually - i just enter the tool number in the "Current tool" DRO and hit enter - the Z DRO changes so i presume it is calling the G43H** itself. I have not tried it from code yet as i have only run one little tiny job so far - I need to understand and trust the system before i start throwing jobs at it.

The task seems simple to me - cut away all the crap and the code is just a couple of lines - set a reference Z (in machine coords, lets call it Zm) using my Haimer against the the touch plate. Then store the Zm value in a variable. Next you replace the Haimer with a tool and do a G31 probe fast, followed by a 1mm lift followed by a G31 slow, at that point you read Var 2002 which is the Zm at the point the probe hit the plate, do a simple sum and bobs your uncle - you now have the tool offset. Bung it in the tool table and off you go.

Now, is the Var2002 taken from MachineZ or WorkZ ?? This is vital so does anyone know?? If it is WorkZ then thats the answer as there is no point comparing Zm with Zw - it all must be Zm.

Anyone know for sure?
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 19, 2016, 03:22:26 AM
Aaahhh - I may well be misunderstanding you here, but ...

set a reference Z (in machine coords, lets call it Zm) using my Haimer against the the touch plate.
But this Zm is meaningless once you replace the Haimer with a tool bit! You have not allowed for the length of the Haimer have you?
Of course, I may have completely misunderstood what you wrote, which is easily possible.

IF I am right (IF), what you need is a ZTO: a Haimer or some such set up on the mill table, to register the tip of each tool. But in addition, you need to know where the ZRO is wrt the surface you are about to machine. In fact,you often need TWO touch probes for this work. First, a ZTO on the mill table to calibrate each tool, and second one in the spindle to measure the ht difference between the work surface and the ZTO on the mill table.

On the other hand, I may have misunderstood everything, as (MYOG) touch probes and ZTOs are what I am working on myself right now. Biased perspective.

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 03:32:28 AM
A manual tool setter like I made would, I think, have been much better for what you want to do. You could set up 10 tools in the time it is taking you to change 1 tool ;)
Place tool in holder on setter, lower setter to tool, press button, enter offset number press apply/ok on tool table.
repeat for next tool etc etc.

No need to place tools in spindle which even with a power drawbar will take longer than placing a tool in the setter.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 03:51:46 AM
Yes I realise your version is good Hood, but i have to work with what i have - don't forget i am on R8 tooling so need to measure each tool in the spindle.

Rcaffin - what i am trying to do is get a reference point - I use the Haimer to read a point on the table - in my case the top of the touch-plate, then i note the Zm DRO - this gives me a fixed point WRT the Haimer.

Now, replace the Haimer with a tool, and do a G31 to the touch-plate, now read the Zm again - there will be a difference, an offset, that difference is what i need in the tool table so that whenever I use the Haimer to find TOM, I know that the offset will be the same and whatever tool i fit will be zero on the TOM.

Its just finding differences thats all, but to work it must use the Zm not Zw, I need to know when the G31 hits the plate and sets #2002 does it set it with ZM or Zw ??

There is a world of difference here as if it is Zw it will not work unless the Z DRO is zeroed properly - this needs testing as it would explain things a little more.
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 04:27:26 AM
What I think you may need to do is bring the haimer down, set Z Dro to Zero, put tool in run routine, etc etc then haimer in again and bring it down to material and again zero. You will have to make sure the offset the haimer is on is the same on the first touch off and zero as the last one. Now whether you have the haimer set as a tool offset or  just as zero offset I don'tthink it will matter, the important thing is you zero the Z DRO.

Regarding the height setter, if you are using collet chucks or endmill holders rather than R8 collets then there would not be a problem with the height setter way I use. There is a taper holder the tools fit in so they all register at the same height as they would in the spindle.


Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 04:34:40 AM
Yes, i think it all relies upon the Zdro being zeroed, i didn't do this yesterday as i presumed the G31 would read the machine dro, I will verify tonight.

Your suggestion is what i wanted t o do - use tool zero as TOM setting with Haimer and all tools are relative to that setting then as that is how they would be measured.

I like your setter but i think there is a big void between your usage levels and my mini-usage level at present ;)

What is the reading device you used?
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 04:48:31 AM
On the Beaver NC5 I use a rotary encoder and belt system, first two pics.
On the Chiron I use a glass scale. Last pic.

No difference with the way they work just the glass scalle is a neater solution.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 05:17:44 AM
As you say, the glass scale is neater, but i do have an encoder floating about somewhere, would just need a short linear guide of some sort.

Will bear it in mind ;)
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 05:36:11 AM
Yes, some form of linear guide just to keep things fairly rigid but easily moved. A couple  of round rails and bushes would do the same, just I had profile rails I bought cheap off eBay a lot of years ago, got 4 500m long rails and 4 trucks for under £10 delivered, I knew they would come in handy at some point. They are all used now, two of them on the height setters and two trucks and a rail chopped in half on the plasma Z.


Before I had the height setter I used to touch off the tools in the spindle and had the button to set the tool table in a similar manner as I use now.
 The  Beaver has a  hyd drawbar, so just a press of a button and the tool is loose, release the button and it clamps instantly but the  height setter is 10x quicker than that, no movements of X Y Z axis required :)

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 06:47:08 AM
Here it is, new in box, only 600 ppr but voltage will match the CSMIO ok.

:)
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 06:49:27 AM
Oh hang on, when you mentioned voltage just thought, do you have the Enc module? That is where I input it, not sure if it would be so easy or even work via a normal input.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 06:55:18 AM
Ah, no, i was thinking just input via one of the spare encoder channels?

Also just found a bunch of these, basic linear movement rails, adjustable for slack, pretty smooth, would work ok i think.
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 06:58:37 AM
Ok not sure how that would work, better do some testing before you go to too much trouble.

Rail looks like it would work fine, doesn't need to be anything fancy, just has to have limited movement other than the direction of travel and no twist.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 07:32:31 AM
It might work but only with Mach in reset.

Think of it - as i have it now, with Mach in reset I can spin the motors by hand and the DRO's all dance merrily around - I think this is what we're after with the height setter?

BUT put mach in run mode and an encoder input without commanded motor move would throw an ePid fault i think.

I reckon it will work, what is in the behind the scenes stuff - macro's etc?
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 07:54:12 AM
I think your problem may be accessing the DRO. The Enc Module DROs have a modbus address but as far as I have seen the motor encoder inputs are internal and I have not seen any way to read them.

Regarding the workings, just some simple code in a button, here it is but as said it is looking at the Enc mdules address.

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)


Also looking at that code I see it has a check to see if Mach is in or out of Reset, so I must have put that there because it doesn't work when in Reset.

Hood
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 08:01:29 AM
Sorry the code above is old, must have been the days before they actually had an oem code for the dro and I was using a brain to write to a user dro, here is the code I have on the actual machine.

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

Offset = GetOemDRO(100)

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

Tool = GetOemDRO(1555)

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

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 08:04:06 AM
Hmm, but the DRO's on screen work fine from the encoder inputs when Mach is out of reset, surely it could just be wired as axis A using the fourth DRO on-screen??

I must have my simplistic glasses on today and probably missed the point by a mile or so.

To make this work, I need an encoder to be connected to a screen DRO no?

:)
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 08:17:54 AM
Ha ha actually I must also be doing something else as the DRO I am looking at is just 100, will have a look, maybe have something in the macropump.

Hood
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 08:20:50 AM
It might work that way, not sure what the it  reads though, would it be machine coords or offsets, would it matter? not sure ::)

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 08:28:25 AM
I might be a nautical mile off target here, its Friday after all:) but as i see it, to make this work I would need the mechanical axis linked to an encoder. That encoder only needs to be calibrated to show mm in a screen DRO in Mach3??

Then I would place the Haimer in a turned dummy R8 socket, place the head on the Haimer and zero the DRO, replace with a tool and the DRO would now show the offset?

Maybe too simple or am i missing the point here? ;)
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 08:36:14 AM
Way I work it is I let the setter go fully down and then press a button on the screen which sends the index pulse to the Enc Module which in turn resets the Enc Modules counting, ie sets zero. So I suppose similar to setting machine coords zero.
Next I place the Haimer in and bring the setter down on it until the haimer reads zero, I then press the screen button and type in 100 (that is the tool I have the Haimer set as) and it writes the offset to the tool table, I then repeat for all tools I want.
The Haimer only needs set up the once, dont have to do it each time I use it.

So when actually wanting to use the tools I put the Haimer in and call G43H100 bring it to the surface and zero work coords. Now any tool I call with its height offset is correct.

Hood
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 08:40:32 AM
Ok just looked and I do have code in the macropump. It looks at the Enc modules DRO  and then scales it so that the units are mm then writes it to the DRO I have set up in Mach. You wouldn't have to do this if using an axis as you would calibrate it via Motor Tuning using the steps per unit.

Now as I said I have looking to see if Mach is in the enabled state so there must be a reason for that, will check in a bit and see what it is.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 08:42:41 AM
Hmm, I don't think I'm that far off the mark really, my major omission is that i don't record the length of the hammer as a tool, i use (or tried) tool zero.

So basically, if i can get the encoder into a Mach DRO, it should all be do-able?

What do you do when say a tool needs replacing etc - whats the sequence then?
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 08:44:46 AM
I think the big issue is - will the CSMIO allow me to have an axis with an encoder but NO motor on it without throwing a hissy fit?

As i said before - probably not when out of reset due to ePid fault BUT I only need it when IN reset :)

Obviously would have to make sure Mach did not include that axis in Ref-All.
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 08:50:04 AM
Ok just looked, you need Mach enabled, reason being is the script uses G Code to write to the tool table.

So your idea of having Mach in Reset wont work.
You could possibly get round the epid problem tough by setting a massive following error for the axis you have the setter on.

Regarding replacing tools, simply zero the setter, place the tool under it, press the screen button and enter the original tools number into the popup screen and that is it. New tool height overwrites the old height.

Hood



Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 09:00:36 AM
Yes, that would make sense, also the following error fix too ;)

Im still a bit grey though on function, you set the setter all the way down, does this position matter though - where is "all the way down" in reference to an R8 socket?

Yes i can see calling the Haimer 100 (etc) would be good, storing the height - but what height? Where is zero?

Would it be just the top edge of my fake R8 socket - touch that as home and zero the DRO then insert T100 (Haimer) set to zero on the dial and store the height?
Then insert other tools, read the height and store them?

If yes then its a little clearer - I am currently measuring offsets you are measuring heights - similar but not the same.
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 09:39:33 AM
I let it go all the way down as that is a repeatable position to then zero the DRO (basically setting machine zero) That position never changes from day to day, so as long as you have a means to accurately repeat for the setting the DRO then you are fine.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 09:46:41 AM
Ah, making sense now, so its just a position that never changes and we call that zero, got it.

Looks like i have most of the bits in hand, also got some nice light 6mm GT belt and pulleys from the 3d printer junk box, the specs for the encoder look like it can take a radial load of over 3kg on the shaft so it should be able to support a pulley and a couple of feet of 6mm timing belt easily :)

I have asked CS-LABS about the motorless axis but i have a feeling it will quicker to just throw the encoder in there and try it out.

I think it would be good to not be using the G31 method if i can get all this stuff together :)

Looking good;)
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 09:47:23 AM
.
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 09:53:58 AM
Oh bum, never that simple is it.

Just reading the CSMIO manual and i see it states that the encoders must have differential inputs, this one has common outputs and they reckon it needs a signal converter?

Back to the drawing board :(
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 19, 2016, 10:28:50 AM
Hmmm, going out on a limb here but...

Does anyone know if there is a difference between the encoder inputs on the CSMIO-IP/A and the encoder inputs on the CSMIO-MPG units????

In the IP/A manual it states that connecting the A-/B- inputs on the differential inputs to ground for using a common cathode TTL encoder will result in distorted axis position, BUT in the MPG manual this is exactly what they show ????

So both units are differential input but one can take common encoder inputs and one can't ???

Or is that for an MPG it really doesn't matter that much and if so will it matter much for this task???
Title: Re: Tool Offset Macro...
Post by: Hood on August 19, 2016, 06:28:23 PM
Why not just get a line driver and connect, will only cost a few £

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 20, 2016, 03:15:39 AM
Err, ok, whats a line driver?

Google time......
Title: Re: Tool Offset Macro...
Post by: Hood on August 20, 2016, 03:37:11 AM
http://uk.rs-online.com/web/p/line-transmitters/0630875/

Thats the ones I used to turn the  Step/Dir signals from the ESS into differential for my servo drives.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 20, 2016, 03:44:21 AM
Hmm, ok, thats looking interesting, does it need much/any supporting circuitry to make it all play?
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 20, 2016, 03:46:53 AM
They work well, but you need to mount them right at the encoder for best effect.
Single-ended encoder signals in - you may need pull-up resistors there.
Differential output: you will need screened 8-core cable from the encoder to the driver. 2 wires for power and ground, 2 wires for A, 2 for B and 2 for I.
Put a 0.1 uF cap across the supply at the chip.

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 20, 2016, 04:02:17 AM
Thanks,

just found this from Hood in the past on his Beaver Mill, looks like it really is that simple.

https://www.machsupport.com/forum/index.php?action=dlattach;topic=21149.0;attach=29905;image

The encoder only has 1m lead on it so that can be shortened a bit, got a chip on its way, already got vero board and plenty of caps etc, sounds like a project coming on :)
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 20, 2016, 04:09:21 AM
You will also find little screw connectors at RSComp, as shown here. They are really very nice - beats the hell out of soldering the wires to pads on the board. And you can stick the voltmeter probe on the recessed screw heads as well.
The central PCB is actually 3 encoders' worth of optical isolation. It may be overkill - or it may not.

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Hood on August 20, 2016, 04:56:18 AM
Personally I think I would just solder direct to the line driver for this application as it will be right at the encoder and can probably be housed inside or even taped direct to the body of the encoder.
Hood
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 20, 2016, 05:16:21 AM
Well, yes, that is another way of doing it.
My concern is that every time I do something like that, the chip dies and it is then a huge hassle replacing it. Murphy!
Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Hood on August 20, 2016, 05:19:00 AM
One word,
Socket :)
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 20, 2016, 05:26:26 AM
Oh, for sure. Until I get into the surface-mount devices. Some of the stuff seems to be only available these days as SMDs.
Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Hood on August 20, 2016, 05:29:09 AM
Yes, smd is the future or suppose really the present, sadly my eyes are not the past :D

Here is a wee board I made up using the sockets, it was before the CSMIO days so had to convert the Step/Dir to differential. I got a few boards printed, was needing it for use with the Scorpion board I was testing at the time, big brother of the ESS I suppose.

Hood
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 20, 2016, 06:01:53 AM
I like.
Getting PCBs made locally is a bit more $$. So I engrave my own using double-sided laminate. Earth on top side, tracks the other.
I do it on a vacuum table. Not as smooth-looking as yours.

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Hood on August 20, 2016, 06:46:50 AM
Yes, works well, did that for a prototype I was designing for a customer.
Hood
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 20, 2016, 07:21:07 AM
Oh VERY nice!
I haven't got that far yet: all I have bothered with has been isolation routing, rather than defining actual tracks. The isolation stuff is dead easy with almost zero learning curve. Actually making tracks means brushing up on a PCB program - and the only ones I have are ... antique. Anyhow, other fish to fry right now (always a good excuse). What do you use?

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 20, 2016, 07:38:32 AM
Nice stuff, i think this one will be ok on vero board mounted near the encoder and using a socket, keep it simple;)

Had another mess with the G31 routine and it certainly did nothing to enhance my trust factor!

I wanted to try after setting Z dro to zero but it made no difference.

It was repeatable but wrong, no idea why or where the numbers are originating really, and if i can get the height setter working i really won't care, but it is baffling to say the least.

Title: Re: Tool Offset Macro...
Post by: rcaffin on August 20, 2016, 07:42:57 AM
Hi Dave
I think you are looking at the problem with the wrong eye ... Try the left one?
Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Hood on August 20, 2016, 07:44:49 AM
I did it in SolidWorks :D

When I moved onto the final stage (smd's and manufactured boards) I used the customers PCB programme, think it was called Easy PC
Hood
Title: Re: Tool Offset Macro...
Post by: Hood on August 20, 2016, 07:48:52 AM
Dave, the benefit I see of the G31 are for people that can not have repeatable tool lengths, ie the're using R8 collets or similar.
With collet chucks or end mill holders then you can swap tools in and out of the spindle repeatably and I think the Height Setter is much more efficient for that.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 20, 2016, 07:58:28 AM
Yeah, i can see the appeal of the setter, just need to get the parts in but i can start by building the mechanical parts now.

With the G31 idea, i just like to know why things do what they do, i don't like being beaten by the system ;) In theory it should work but something is just not so with it. I think i have expended enough time on it now though so will have to brush it under the bench.

As i said before, the thought of NOT having to G31 with tools in a powerful (if weakly built) spindle is very appealing now, and if that IC works and the CSMIO plays ball then the total cost of the setter will be £3.90 so well within budget ;)

Title: Re: Tool Offset Macro...
Post by: rcaffin on August 20, 2016, 07:59:27 AM
the benefit I see of the G31 are for people that can not have repeatable tool lengths, ie the're using R8 collets or similar.
Indeed. Two very different situations. As I am using ER25 collets with unringed bits, that describes me. An actual off-line tool-setter would be of no use at all to me.

So I will be using a table-mounted ZTO to sense each tool tip, and a spindle-mounted Z touch probe to measure the fixed ht difference between the ZTO surface and the top surface of the job. Naturally, I have to make these rather than buy them. But I wonder - would this work for Dave? It might be a lot simpler.

Cheers
Roger

Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 20, 2016, 08:05:25 AM
Thanks for the thoughts Roger, appreciated, but the setter really is a neat accessory in this instance, the ability to change tools and reset in a matter of seconds is good too as i could only afford one batch of ER32 chucks at present, I chose the bigger '32 series as i wanted to keep the difference between the height of the Haimer and the range of tools i have to a minimum as i have limited Z travel on the Bridgeport.

If i can get it all going for a couple of quid then its a no-brainer really.

I will still need the G31 basic TOM routine for the engraving spindle though , but that does work ok so no worries there.
Title: Re: Tool Offset Macro...
Post by: Hood on August 20, 2016, 08:08:18 AM
Dave, you not VAT registered, it would have been cheaper if you were ;D

Roger, I use ER collets as well but they are in collet chucks which fit in the spindle so I can take a chuck out and then put it back in and it repeats exactly. If I need to replace a worn or broken tool then I just pop it back in the setter and press the screen button and enter the same number and thats the new height set ready to be placed in the tool changer.
 If your spindle itself has the collets direct then the G31 will be the way to go.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 20, 2016, 10:26:37 AM
Found this in the lathe this afternoon, not much but it's a start;)

Once upon a time it was a mandrel for turning traction engine big-end bearings, now its an R8 socket mount :)
Title: Re: Tool Offset Macro...
Post by: RICH on August 20, 2016, 05:10:23 PM
Dave,
Make a bunch of small accurate collars (say 1/4" thk with a set screw) place on the each end mill to restrict how far the end mill
enters the R8 collet. When the collet gets snug move the end mill into it as far as the collar allows and complete tightening the R8.
Match mark placement orientation.
The collars provide for quite accurate repeatable length as defined in a tool table. Try it out and may be satisfactory.
Poor mans quick change holder for the mill!

RICH
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 20, 2016, 06:00:17 PM
Hi Dave
Different machine, different needs. Always interesting to see how others do it. I keep learning.

Make a bunch of small accurate collars (say 1/4" thk with a set screw) place on the each end mill to restrict
Lots of companies (like Precise Bits) sell tools with plastic collars or rings already fitted. I gather they press-fit the cutters into the collars. Does anyone have any idea what plastic they use? It's pretty hard stuff.

I use ER collets as well but they are in collet chucks which fit in the spindle
Yes, my ER collets fit into a Kennelec BT-30 adapter, so that would in principle be possible. However, the top end of the BT-30 - the drawbar, is well inside the Z housing and it would be rather painful to access it each time. 'They' did not design the machine for easy access to the internals of the Z axis - but it is VERY robust. And those BT-30 fittings are 'not cheap' either ... Thing is, I use such a wide range of tools I would need dozens of BT-30 chucks. Ah well, I am having fun.

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 21, 2016, 04:00:19 AM
All good stuff, i did see the collar idea on the mini-tooling for the engraver;)

I've got 12 ER32 chucks a couple of weldon holders which i don't really like, and my favourite Clarkson Autolok - this is useful because the location method of the tool makes any tool repeatable as they are pulled against a pip in the chuck that locates the centre-drilling in the tool end, only works on threaded tooling though.

I think I will have enough to get going now, this has been a real eye-opener so far, you never realise when being manual-only how much needs to be done to convert to even basic CNC.

Need to make an R8 tool rack now though, usually just keep them in a drawer but needing to be numbered changes that.

There is also the TTS/ER25 holders I have on the watch list - these would be great for drills. The main down-side with R8 is the length of the tool, I will have to program the table to go max Y++ at tool-change  to allow me to get the tool in and out easily, luckily not a problem with CNC :)
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 21, 2016, 04:12:57 AM
Oh yes, the CNC world is very different. Sometimes I think it would be easier to make a one-off on the manual lathe or mill, but I am fast learning that a) the CNC is much more accurate then me, b) correcting a mistake on the CNC only means a tweak to the program and a rerun, and changing significant parts of the design on the CNC is just a few more tweaks to the code and a rerun (all compared to redoing the whole thing on a manual).

Tool racks are essential imho, to keep stuff tidy, know just what i have got, prevent rusting, and avoid damage to cutting edges.

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 21, 2016, 04:17:59 AM

Single-ended encoder signals in - you may need pull-up resistors there.

Cheers
Roger


Nope - just checked the manual and it outputs a voltage signal, resistors built-in :)
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 21, 2016, 04:23:54 AM
Yes Roger, i have discovered the easy-edit nature already ;)

I could have made good use of CNC years back - things like making expansion links for traction engines - in the manual world this means making jigs and contraptions for milling massive curve radii - long chunks of plate on pivots and a rotary table under one end, hours to set up, sometimes a whole day, just to mill a slot and a couple of curves - this would be a doddle with CNC. Many new builders now get these parts wire eroded or water jet cut.
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 21, 2016, 04:27:01 AM
Many new builders now get these parts wire eroded or water jet cut.
Hum ... why don't they get the whole thing made for them? It is not as though it is a hobby, after all.

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 21, 2016, 04:35:06 AM
Its just one of the really awkward bits to do i guess, I found the whole thing very educational, having a 300kg boiler on the bed of a Bridgeport really focuses the attention on clamping :) Or milling the centres of 48" rear wheels, 24" main gears....Happy days. I can't believe I even bought a massive horizontal mill just to cut gear teeth!

But, in the long run, if having some difficult bits pre-cut gets another engine in the build then it's all good;)
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 21, 2016, 05:53:54 AM
milling the centres of 48" rear wheels, 24" main gears.
Um - forgive me, but that sounds like a full-size engine. Is this a scale model?

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 21, 2016, 07:27:09 AM
Its was a Half-size model :)

Apologies, the wheels were 36" not 48.

A few pics below;)
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 21, 2016, 08:06:36 AM
Good God Emily!
You steam train enthusiasts are stark raving mad ...

Impressive thing. I take it one can ride on the carriages at Open Days at the local Club Meets? There's a club nearby which does that, but I suspect theirs is 1/4 scale.

Blimey.
Chers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 21, 2016, 08:23:05 AM
That engine would easily pull a cart with 6-8 adults on plus water and coal around a rally field;)

Rail based stuff is a different scaling designation but just as powerful, steam is a wonderful thing:)
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 21, 2016, 08:35:09 AM
Um - I think theirs is on railway track. They have some permanent ways there.
Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 24, 2016, 09:54:40 AM
still waiting for parts but got a reply from Cs-Labs today, they reckon its not the correct way of doing stuff - using an axis input and Mach DRO BUT cant see why it wouldn't work :)

Seems i should be using the ENC module channels 2 or 3 for this.

Will have to see what happens before spending more. Got the linear motion part built and fitted the encoder, just waiting on the line-driver now.
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 24, 2016, 12:09:46 PM
Ok, line-driver IC just arrived, will get it wired tomorrow morning as its stupid-hot in the shop now.

I gather its just inputs on 1A, 2A, 3A and outputs on 1Y/1Z, 2Y/2Z, 3Y/3Z with a 0.1uf on the supply rails?

Ignore the G input which i presume is a gate?
Ignore unused 4th input?

Thanks
Title: Re: Tool Offset Macro...
Post by: Hood on August 24, 2016, 05:18:45 PM
From memory you need to connect the G to 5v or the G- to 0v depending on which way you want to have the output with regards the Hi or Lo of the input pulse.

Hood
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 24, 2016, 05:26:46 PM
Just don't leave any unused inputs floating.
Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 25, 2016, 03:08:41 AM
Ok, so G has to go one way but in this case it won't matter which way ?

And tie unused inputs to 0v.
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 25, 2016, 03:14:19 AM
If you are not using the G outputs ... where input goes does not matter.
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 25, 2016, 03:26:08 AM
Just had another look, there are no G outputs, its internal and used to flip the outputs into a third state of "off", looks like for logical use G needs to go high.
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 25, 2016, 03:56:06 AM
Basically, you need to enable the outputs.
I used the 26LS31 instead, but same idea.
Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 25, 2016, 05:22:14 AM
Ooh, nice, little circuit works perfectly :)

Ok, now the next step:-

When mach is in reset the DRO works perfectly, accuracy can be set with motor tuning - nice.
But, we can't run the G-Code to read the DRO and load it into the tool table - what Hood said would happen earlier. The CSMIO still gets the data but does not let Mach see it unless in reset.

So, how do we tackle this hurdle :)

Do we have access to the CSMIO data, maybe we can read it direct, scale it and save it?

Any suggestions :)
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 25, 2016, 05:41:50 AM
I am totally confused here. My machine does not behave that way.
When you say 'in reset', do you mean as though an eStop has just been done?
Does the rest of the machine work -  X, y & Z axes move etc?

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 25, 2016, 05:45:01 AM
:)

To me "in reset" means Mach is not active, out of reset is ready to work.

Not quite an e-stop, just press the reset on mach screen.
Title: Re: Tool Offset Macro...
Post by: Hood on August 25, 2016, 06:22:25 AM
Have you tried what I said earlier? Have Mach out of Reset and just have a massive following error set for the height setter axis so that it does not trip?

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 25, 2016, 06:43:57 AM
Yes that works well, BUT the DRO in mach does not update if mach is active and there is no motor feedback.

Out of reset it works well but no G-Code, not the end of the world but not 100% cool ;)

Title: Re: Tool Offset Macro...
Post by: Hood on August 25, 2016, 06:48:33 AM
Ah ok, not so good.
What about  having a routine.
Have Out of reset and Home it (set zero)
Put in Reset and move it onto tool.
Take back out of Reset and press the button to update the offsets?

Could maybe even be integrated into the button with a few message boxes informing you what to do next.

Or you could splash out for the Enc module and have rigid tapping as well ;D

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 25, 2016, 06:54:34 AM
Yeah, i was one step ahead of you there Hood :)

I did think of automating it but of course as soon as the macro takes mach out of reset its game over for further macro code ( i think? ) Can a macro put Mach back in reset???

There is always a way, your suggestion is exactly my line of thought and will work, just a tad clumsy, but hey if it means i get a height setter for £3 then its not all bad :)
Title: Re: Tool Offset Macro...
Post by: Hood on August 25, 2016, 07:06:07 AM
Well I know the button I use works when Mach is in Rest, just the G Code part wont. Hence the reason the button code checks  whether Mach is In or Out of Rest  when the button is pressed.
Now whether the button would work whilst flip flopping between IN/ Out of Reset I don't know.
As for the button being able to take Mach In/Out of Reset, probably not, should be able to put into Reset but don't think it will allow you to take out.
The reason I say that is I had a weird one when I first started using the Chiron, couldn't get out of reset and was a while before I worked out it was because my Screen was from the Bridgeport and I had a VB Rest button which would take out of Rest then looked at encoder  feedback and compared  Machine coords and asked whether I wanted to update (if required)  The IP-A would not come out of reset via the button code.
Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 25, 2016, 07:10:22 AM
sounds about right, didn't think you could macro out of reset.

still, as soon as i get the pulley and belt fitted I will have a working height setter at least, even if slightly clumsy, still better than the probing idea i think.

automating the job via messages would work, the dro does stay where it should when going in or out of reset and if you move it when in reset it does update when going out of reset :)
Title: Re: Tool Offset Macro...
Post by: Davek0974 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 ???
Title: Re: Tool Offset Macro...
Post by: Hood 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
Title: Re: Tool Offset Macro...
Post by: Davek0974 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 :)
Title: Re: Tool Offset Macro...
Post by: rcaffin 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
Title: Re: Tool Offset Macro...
Post by: Davek0974 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.
Title: Re: Tool Offset Macro...
Post by: rcaffin on August 25, 2016, 08:33:35 AM
This is a kludge, but its practically free
Hard to argue there!

Cheers
Roger
Title: Re: Tool Offset Macro...
Post by: Davek0974 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?
Title: Re: Tool Offset Macro...
Post by: Hood 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
Title: Re: Tool Offset Macro...
Post by: Davek0974 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 ;)
Title: Re: Tool Offset Macro...
Post by: Davek0974 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 :)
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 26, 2016, 01:12:22 PM
Well, apart form the hiccup mentioned above, it works very well, I now have 10 tools set up and have tested each one - Z0 was the same in all cases once set with the Haimer, switching tools is just a matter of entering the right number in the "current tool" DRO. :)

The hiccup above "can" be worked around but it is a serious PITA - you have run the routine, go into reset, come out of reset, abort the routine, start again and this time it all works ok. So this means going in and out of reset twice for every  tool, not good.

I presume to fix this i will have to stump up the cash for the ENC module?
Will that mean it will all work with Mach active?
Does it still show up as a DRO?
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 26, 2016, 02:58:08 PM
Picture attached of my setter version 1 :)

As for the remaining issue detailed above, I could very likely save time pi22ing around and just measure the tools and write the heights down then enter manually in the tool table, until funds allow the purchase of the ENC module.
Title: Re: Tool Offset Macro...
Post by: Hood on August 26, 2016, 03:33:25 PM
Yes, the Enc module counts whether Mach is In or Out of Reset, so no probs there, obviously it is Out of Reset you will want..
The DRO is purely counts and you need a Brain or Macropump to scale that to your correct distance (ie setting steps per unit) and then you can write that to a user DRO or even the Encoder DRO in Mach, think that is what I use.
You will also need to rewire things a wee bit as you do not want the Index from the encoder going into the Enc module as that is what sets the DRO to zero and as such will do each revolution. CS-Lab said they would look into giving you an option to manually set zero but don't think they ever did. I got round it by simply having the Index on the Enc module pulsed from an output via a screen button.

Looking good, just make sure the angle part that touches the tool is flat and a true 90 degrees or you may get a variance from small to large dia tool. That is the reason my tool holder slides, I can set it so the tip of any size cutter is on a specific (machined) part of the setter.

Hood
Title: Re: Tool Offset Macro...
Post by: Davek0974 on August 26, 2016, 03:45:50 PM
Thanks. i'll save some funds up for the ENC module but at least i have a workable system now :)

Yes there is room for a small improvement in accuracy by re-working the angles etc, your sliding version is a neat fix, i can see a difference in about 0.6-0.1mm between my usual size tooling and my biggest tool which is a 50mm face mill. Clearly a small angular error but these are all stock parts used so not bad really, I know its there so i know what to do to fix it.

For my normal range of tooling from spotting drill to 14mm end mills/slot mills the accuracy is surprisingly good.