Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: rcaffin on February 14, 2011, 05:39:06 PM

Title: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 14, 2011, 05:39:06 PM
I am using a lathe with a custom multi-head tool holder.
Mach has a nice system which lets me position each tool to the job, hit Touch X/Z, and set up the tool table. This works well.

However, when changing tools (T202 etc) in the program, I have to M3 after each tool change, So there is a very long delay while the chuck stops, and then spins up again.  So, questions:

Is there any way to tell the system to just change the tool table entry used and NOTHING else? ie, no long delays. (Yes, I know I have to clear the job first!)

Or, is there any way to set up work offsets automatically, tool table style? I could juts as easily flip work offsets for this job.

Thanks
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 14, 2011, 05:44:16 PM
Do you need to stop the spindle? Or are you using the option on General Config to Stop and Wait? If the latter then possibly  you could set to Auto Toolchange and in your M6Start macro you could just issue a feedhold or similar.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 14, 2011, 06:20:59 PM
No, I don't need to stop anything. Just change the entry in the tool table being used for offsets.

I have the system configured to use the Auto-tool change option now, but it still stops the chuck when the program does a Tn command.
In fact, if it is using T2 and the program issues another T2 (for safety reasons and the program is modular), then it still stops the chuck.
I am using the stock M6Start mand M6End macros - they don't seem to do anything with the chuck.

Puzzling.

Cheers
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 14, 2011, 06:23:44 PM
In Turn only the m6start is used. Dont recall whats in the m6 start macro as standard as mine is a custom one.
My spindle never turns off unless I press stop or call m5.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 14, 2011, 06:33:04 PM
In Turn only the m6start is used. Dont recall whats in the m6 start macro as standard as mine is a custom one.
M6Start:
  tool = GetSelectedTool()
  SetCurrentTool( tool )

Quote
My spindle never turns off unless I press stop or call m5.
Yeah - that is what I want! But I can't get it to happen. Very strange.

Cheers

Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 14, 2011, 06:34:53 PM
Can you attach your xml, your tools3.dat and some code and I will see if I can simulate here and get the same issue.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 14, 2011, 06:58:19 PM
Hi Hood

I will ... but I seem to have hung up the Forum SW with the attachments. Working ...

Cheers
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 14, 2011, 07:03:17 PM
The program
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 14, 2011, 07:04:57 PM
The 4-head unit
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 14, 2011, 07:06:26 PM
The XML
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 14, 2011, 07:10:25 PM
The tools3.dat, renamed as TXT because I can't upload DAT files here.
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 14, 2011, 07:41:41 PM
Well afraid I cant seem to load your code, get a too many nests error. Looked at it and its way beyond my knowledge of code ;)
However I loaded your xml and tooltable and ran some of my code and it ran fine, spindle only stopping when commanded and not at tool changes so I am guessing that its your code that is doing the stopping.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 14, 2011, 07:47:27 PM
Oh BTW if you are threading you really want to have Use Spindle Feedback in Sync Mode chosen.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 14, 2011, 07:50:54 PM
Now that is WEIRD! All my code looks like that and loads and runs just fine.
OK, I have about 40+ years experience programming computers at all levels, so I tend to think that way. Mind-set!

I have attached a very simple version of that program with just one subroutine call. Could you try it maybe?

Spindle mode for threading - yes, I do that on the 'real' machine. The XML is from my simulation machine.

Cheers
Roger
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 14, 2011, 07:54:01 PM
Ok get return called with no sub in effect looping error with that one.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 14, 2011, 08:16:08 PM
Damn!
Rule 1 of SW: there is always one more bug in the code than you think. That was a hacked down version of the original of course, and there was a superfluous m99 in it.
The attached has been fixed and tested.

I am wondering whether the real problem is the M3 instruction after the tool change. That basically says to start spinning, and should be a no-op if the spindle is running. I need to look at the macro  to see just what it does.

Cheers
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 15, 2011, 02:19:57 AM
Sorry had to sleep ;D
Just tested with your xml and the only time the spindle switches off is at the end so looks like your M3 macro could well be the issue.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 15, 2011, 03:54:59 AM
Just tested with your xml and the only time the spindle switches off is at the end so looks like your M3 macro could well be the issue.
Nice thought, and I wish it was so. But all that is in M3.m1s is:  DoSpinCW()

If I leave the M3 call out, the spindle still stops when it gets a Tn0n command. It just doesn't start again.
So I have to say I think it is the T command which is doing the stopping - even when AutoChanger is selected.

Is there some other switch in the XML or elsewhere I wonder?
V3.042.040

Cheers

Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 15, 2011, 06:15:01 AM
I am testing with the latest lockdown but will go load the older version you have just in case that makes a difference but definitely no spindle stop here at tool change. The only other thing that is different is I am using a different screenset as I dont have the one you have loaded, so may be worth trying the standard screenset.
Only other things I can think of that could affect things is if you have a plugin or brain or macropump that is interacting. You dont have macropump enabled in the xml but not sure about the others.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 15, 2011, 06:25:04 AM
Just loaded 042.040 and its still fine, so look at screenset, brains and plugins to see if there is something there that could be the issue.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 15, 2011, 04:05:14 PM
Just loaded 042.040 and its still fine, so look at screenset, brains and plugins to see if there is something there that could be the issue.

Stock screenset - 1024.lset
No added brains
Stock plugins, as delivered.
I don't think the macro-pump has been enabled either, but I will check.

I am using the SmoothStepper on my system - are you?

Cheers


Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 15, 2011, 04:08:12 PM
I wasnt because your xml was for the parallel port I think. I can test with the SS and your xml though as I have a spare SS here. All my machines have the SS on them and it doesnt happen with them.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 15, 2011, 04:15:36 PM
Just tried with a SS and again its working fine, tool 2 does its thing with the 5 second delay as it starts then tool 3 is loaded but no dealy at all, just loads t303 offsets and off it goes, cant think why your not getting that.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 15, 2011, 04:19:11 PM
Just tried with a SS and again its working fine, tool 2 does its thing with the 5 second delay as it starts then tool 3 is loaded but no dealy at all, just loads t303 offsets and off it goes, cant think why your not getting that.

Hi Hood
Yes - I used the XML from my simulation machine as the other ('real') one is not on the net.
All very strange. I will play some more, and report back, but I wonder whether ArtSoft has any thoughts on the matter?

Cheers
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 15, 2011, 04:42:14 PM
Do you get the delay on the simulation machine? Can you grab the xml from the actual machine and post that and I will test it here to see if its different.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 15, 2011, 04:50:52 PM
Do you get the delay on the simulation machine? Can you grab the xml from the actual machine and post that and I will test it here to see if its different.
Hood

Going out to check over everything yet again. Be back in a little while.
In the meantime, thanks very much for your testing: it gives me some hope that the problem should (!) be solvable.  :-)

Cheers
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 15, 2011, 05:33:51 PM
Hi Hood

Attached is a zip file containing the current real Turn XML, a documented test program, the latest ConfCheck.txt output (all clean) and SS_messages.txt just in case.
The test program shows where the spindles stops: after every tool change command IF it had been spinning. When the spindle stops the Dwell Active LED comes on for the standard time. If the spindle was not spinning when the T command is issued then there is no delay.

Beats me!

Cheers
Roger
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 15, 2011, 06:27:43 PM
Well it took me a while to work out why I couldnt seem to run any code then it sunk in, you use Programme Lockout so I had to set the active state of Input 1.
Anyway onece I got it working it ran fine, no dwell except at the start and no spindle stop until the end. It must be something in the macros that is affecting things as I have just tested with the standard M3 and M6 macros.
I have just taken a screen capture video of it and will upload to YouTube to let you see it running fine here.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 15, 2011, 06:34:01 PM
Hi Hood

Oh, I believe you! No need for videos!

But it definitely is not the M3 macro, and I doubt it is the M6 macro  itself, as both are absolutely stock.

I am going to investigate the program lockout bit. I do not know whether it is relevant or not, but I do know there is a slightly strange and hacked 3rd-party interface deep within the machine - and I have had a few problems with it before.

Cheers
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 15, 2011, 06:37:29 PM
It could be that I suppose as maybe the toolchange for some reason activates Input 1 for a split second which would then shut off your spindle. Just go to General Config and disable it and see if it helps.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 15, 2011, 06:57:17 PM
Hi Hood

Program Lockout tested: makes no difference whether program lockout is ticked or not.

Single step mode through test program: executing the T command stops the spindle if it is spinning and actives the standard dwell.

Sigh.
Cheers
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 15, 2011, 07:02:06 PM
Just dont understand that at all, can you  zip and email your whole macro folder from the machine and I will test with that.
Will pm you my email address.
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 15, 2011, 07:25:40 PM
Hi Hood

Attached - not very many macros in the folder . Hum ...

Cheers
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 15, 2011, 07:37:05 PM
And there is your problem
m6start  macro has


DoSpinStop()
while(ismoving)
wend
tool = GetSelectedTool()
SetCurrentTool( tool )
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 15, 2011, 08:03:01 PM
Hi Hood

OBVIOUSLY!
But the more interesting Q now is where did this come from? I did not edit that file myself, and so far I cannot find the original source. Beats me...

Never mind: I am extremely grateful to you for this! If I can help in any other way, please let me know.

Cheers
Roger caffin
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 15, 2011, 08:06:55 PM
Dont know, maybe it was in some earlier version and it has stuck but I have never seen it before, then again I never look at the standard macros as mine are mostly custom.
At least the problem has been found, thats all that matters :)
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 15, 2011, 08:10:57 PM
Seems to say it was modified on 14th Dec 2010 so maybe you had  a visit from one of the Ghosts of Christmas that likes messing with VB ;D
Hood
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: rcaffin on February 15, 2011, 08:46:30 PM
Hi Hood

Confirming all is well after a real test on the machine.

> Seems to say it was modified on 14th Dec 2010 so maybe you had  a visit from one of the Ghosts of Christmas
Hum ... it may be that the supplier sent me some updates about then. The machine was originally designed for teaching use, and they may have 'modified' it to keep little fingers from being minced. My best guess.

Cheers
Title: Re: Tool offsets and long delays vs Work offsets - help
Post by: Hood on February 16, 2011, 03:00:28 AM
Thats good news, its amazing how small changes can be a real PITA
Hood