Hi Again, Just an update to the thread with the solution adopted. I hate searching threads and never finding how it ended up being done.
I wrote a G Code sub routine called <m6> which takes 2 parameters, current_tool and required_tool. This is no problem, as when you do a tool change you will always know what tool you were using previously. (often just tool1 from the initial machine homing) This sub calculates the number of moves between tools, the number of units required for each move, based upon the tuning of the A axis and the slightly differing distances between tool stations. It moves the ATC forward to just past the required tool and reverses back to stall against the pawl. Using G Code overcomes all the problems of trying to move a previously defined axis during a M6 command. It then calls M6 Tx to match the required_tool. I have linked a hal component I have called hal_autotoolupdate as per below. *loadusr -W hal_autotoolupdate net tool-change iocontrol.0.tool-change => hal_autotoolupdate.change net tool-changed iocontrol.0.tool-changed <= hal_autotoolupdate.changed net tool-number iocontrol.0.tool-prep-number => hal_autotoolupdate.number net tool-oldnumber iocontrol.0.tool-number => hal_autotoolupdate.oldnumber net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared* hal_autotoolupdate is simply based on the hal_manualtoolchange python script, hacked to remove all the dialogs etc. Since the tool change has already been done when M6 is called, all I want the component to do is pass a tool-changed signal back without any operator input, so that the tool number and offsets are updated. You could just feed one into another, as in the ..tool-prepare line, but I wanted the pins available for a pyvcp addition to my set up, to clearly display tool change and offset info. This works perfectly and should work for any similar Boxford, Emco or whatever, that uses the same type of methodology for its ATC. My lathe conversion is now complete and fully functional. I have learnt a lot on the way. Thanks for the help and advice, particularly Andy Pugh for his help getting a threading pulse circuit working. It cut a perfect 1.5mm pitch thread first time, simply using a tool at 90deg to the workpiece. regards Arc Eye ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users