Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: mikemill on July 12, 2014, 09:59:26 AM

Title: Auto Tool Changer Help
Post by: mikemill on July 12, 2014, 09:59:26 AM
I have just fitted an auto tool changer to my Orac lathe and got it to work manually.
I would like some advice on getting Mach to control it, the instructions that came with the tool changer show an input of +5v to activate and an output as status.
I assume I connect the +5v input to a pin on the breakout board and then config/ select a pin in port and pins? Not sure where to connect the status output and what GCode controls tool changers?
Thanks

Mike
Title: Re: Auto Tool Changer Help
Post by: cjmerlin on July 12, 2014, 06:36:16 PM
Hi, Have a look at the post below for some ideas on how to control the Orac toolchanger


http://www.machsupport.com/forum/index.php/topic,455.msg3452/topicseen.html#msg3452
Title: Re: Auto Tool Changer Help
Post by: mikemill on July 13, 2014, 06:55:12 AM
Thanks for reply my ATC is not an Orac original I bought it new on ebay it came with instructions as in my first post, there is a manual button on the ATC one touch turns the unit one station, so I assume one pulse of +5v from Mach would do the same?
So I don’t know if I need a macro, if I connect the input to a spare axis say A on the breakout board, config in ports and pins, then write Gcode  A1 would that activate the ATC?
Although I am well versed with CNC mill operations I have next zero experience with Mach Turn, so any advice would be welcome
Thanks
Mike
Title: Re: Auto Tool Changer Help
Post by: Hood on July 13, 2014, 01:25:48 PM
Do you have a link to the instructions or can you attach a scan?


Hood
Title: Re: Auto Tool Changer Help
Post by: mikemill on July 14, 2014, 05:03:44 AM
Hood
Here are instructions, I have wired up the ATC and works manualy, just need Mach to contol!!

Thanks
Mike
Title: Re: Auto Tool Changer Help
Post by: DICKEYBIRD on July 14, 2014, 09:36:25 AM
Hi Mike, I have an ORAC as well and was curious about your ebay ATC.  Got a link?
Title: Re: Auto Tool Changer Help
Post by: mikemill on July 14, 2014, 10:09:57 AM
The tool changer was on ebay around two years ago a chap called Tony Willson was making them; I tried recently to contact him but no joy.
As you probably know the original Orac tool changers as rare as hens teeth and hence go for silly money when they come up for sale.
There have been several posts on CNC Zone where people have made their own changers, also on YouTube.

Mike
Title: Re: Auto Tool Changer Help
Post by: mikemill on July 17, 2014, 04:40:52 AM
Hood
I found this on the net, do you think it is appropriate for my tool changer or part of it?
Thanks

Mike
Title: Re: Auto Tool Changer Help
Post by: mc on July 18, 2014, 01:11:07 PM
First off, you'll need to wire in the tool changer, which will depend entirely on what spare input and output you have available, and if the TC will connect directly (those datasheets give no details about how much current is involved).

Then you'll need an M6start.m1s macro to handle the control.
Something along the following lines-
Code: [Select]
oldtool = GetCurrentTool() 'Get the current tool position
newtool = GetSelectedTool() 'Get the new tool position

'We'll do a bit sanity checking to ensure a valid tool has been requested
if newtool < 1 or newtool > 6 Then
DoOemButton(1003)
MsgBox"Tool call out of range"
End
End If

if oldtool = newtool Then 'if we've already got the requested tool loaded
End 'then we can quit this macro without doing anything
End If

'if we've made it this far, then we can actually make things move
While oldtool < newtool or oldtool > newtool ' while we're not at the correct tool
ActivateSignal(Output10) ' activate output to start move
Code "G4 P1" ' first half of the required delay
If not IsActive(Input10) ' if our input signal has not gone active, then we have a problem
DoOemButton(1003) ' so stop the current program
MsgBox"TC input status not changed" ' display an error message
End ' and end the macro
End If
Code "G4 P1" ' second part of delay now we know the TC is doing something
While IsActive(Input10) ' we now need to wait until the TC locks
Wend ' so sit in an endless loop while the Input is still active
If oldtool = 6 ' if oldtool is equal to 6
oldtool = 1 ' we need to loop over to 1
Else
oldtool = oldtool + 1 ' else just add one
End If
Wend

' when we finally get past the last while loop
SetCurrentTool(newtool) ' set the current tool to the new tool
End ' and finally quit this macro

I've just thrown this together, so can't guarantee it will work.
Couple points to note -
I've just used Input10 and Output10, which you'll need to change to whatever Input and Output you use.
I've assumed a 6 position tool changer that only turns in one direction (hence the while loop that continually runs while the new tool doesn't equal the old tool)
The only bit I'm not sure about is the oldtool = oldtool + 1, as I'm not sure if it'll work (it should do, but cypress basic has a few quirks and doesn't always follow more normal programming convention!)
Title: Re: Auto Tool Changer Help
Post by: Hood on July 18, 2014, 02:29:52 PM
sorry been busy but looks like mc has you on the right track.
Hood
Title: Re: Auto Tool Changer Help
Post by: mikemill on July 20, 2014, 07:07:12 AM
MC

Thanks for reply and macro, the ATC is an eight position one, also could you attach the file so I can copy it into Mach. Reading the Mach manual it says place macro in Operator/macro file, but on my Mach turn when I click on Operator there is no macro file?
As I mentioned I am a fish out of water when it comes to this area I know it’s asking a lot but could you give me a step by step guide to installing the macro and writing the g code to operate the tool changer.

Thanks

Mike
Title: Re: Auto Tool Changer Help
Post by: mc on July 20, 2014, 06:23:56 PM
Modified file is attached for an 8 position tool changer.

The only bit you'll need to change is the Input and Output you'll be using. There is one place where the Output will need changed, and two places where the Input will need changed.
The file will need copied to <mach3install folder>/macros/<folder named the same as the current mach profile you're using>/ (there should already be various macros in it)

You'll need to change theTool Change (top left) setting in General Config... to AutoTool Changer, so the M6 macros are used.
In your G-Code or MDI, you then simply call Txxnn where xx is the tool position, and nn are the tool offsets from the tool table.
For example T0101 will call tool position 1, along with offsets 1, whereas T0106 would call tool position 1, but with tool table offsets for tool 6.

You can use just Txx, which means the same number is used for tool position and offsets i.e. T01 is the same as T0101, however I prefer to use the full version.
Title: Re: Auto Tool Changer Help
Post by: mikemill on July 21, 2014, 08:40:39 AM
MC

Thank you very much for the macro and info, I have a lot on for the next few days so won't be able to try setting it up, will let you know how I get on

Regards

Mike
Title: Re: Auto Tool Changer Help
Post by: mikemill on July 27, 2014, 08:14:18 AM
MC
I have several questions,
Tried coping your macro file into the macro folder of Mach Turn, but there is a file of the same name already, as I am unable to open them I can’t compare, have attached current file maybe not relevant then can delete?
You mention I need to change the Input and Output I will be using , could you explain, also how do I open, what program will understand the file extension .m1s.
As I understand in G code I don’t need to prefix M6 Txx, just the Txx
I have added an x to file name as can't attach same file name!!
Its fish and water again!!!!
Thanks

Mike
Title: Re: Auto Tool Changer Help
Post by: mc on July 28, 2014, 12:41:39 PM
The macro that's already in the folder will be the generic one that gets installed whenever you create a new profile. You could just delete, but it's probably safer to rename it to something else for now or move it to another folder.

Regarding the Inputs and Outputs, you'll need to configure the relevant signals in Ports and Pins, on the Input Signals and Output Signals respectively. I've just realised that there are only 4 inputs available, but I doubt you'll of used any.
For editting the file, you can use the default windows notepad (if you open the Open... in the menu, near the bottom of the screen that pops up, change the drop-down box from Text Documents (*.txt) to all files - when saving, you'll need to ensure the same box is changed so you don't get .txt added to the end of the file name), or alternatively double click the file click choose program before selecting Notepad.
Title: Re: Auto Tool Changer Help
Post by: mikemill on July 29, 2014, 05:11:22 AM
MC
Have managed to open the macro and note your comments line by line, but it’s not making much sense to me, not sure what I should edit?
Re configuring Mach I am in contact with CNC4PC as using their breakout board.
Am reading the Mach manual trying to get my head around what I need to do? As all I need is a 2 sec +5v pulse to trigger the relay in the ATC
I am getting there slowly!!!
Thanks

Mike

Title: Re: Auto Tool Changer Help
Post by: mc on July 30, 2014, 12:58:53 PM
Within the macro Input10 is used twice, and Output10 is used once.

Once you have connected your toolchanger to the BOB, you need to map the pins used, using the ports and pins menu, to a free input and a free output. You then need to go through the macro, and change Input10 to whatever input you picked in ports and pins, and do the same for Output10.
Title: Re: Auto Tool Changer Help
Post by: Denford Miracle on December 10, 2015, 11:25:27 AM
Modified file is attached for an 8 position tool changer.

The only bit you'll need to change is the Input and Output you'll be using. There is one place where the Output will need changed, and two places where the Input will need changed.
The file will need copied to <mach3install folder>/macros/<folder named the same as the current mach profile you're using>/ (there should already be various macros in it)

You'll need to change theTool Change (top left) setting in General Config... to AutoTool Changer, so the M6 macros are used.
In your G-Code or MDI, you then simply call Txxnn where xx is the tool position, and nn are the tool offsets from the tool table.
For example T0101 will call tool position 1, along with offsets 1, whereas T0106 would call tool position 1, but with tool table offsets for tool 6.

You can use just Txx, which means the same number is used for tool position and offsets i.e. T01 is the same as T0101, however I prefer to use the full version.

so what youre saying is... if you fix the macro m6startx.m1s.  it will be called by a TXXNN?    you don't need to put a M6 in your machining program?