Hello Guest it is April 25, 2024, 02:58:57 AM

Author Topic: M6 Macro Help  (Read 6546 times)

0 Members and 1 Guest are viewing this topic.

M6 Macro Help
« on: July 14, 2013, 10:46:50 PM »
This is what is in the default m6 start macro. 

tool = GetSelectedTool()
SetCurrentTool( tool )

I found this to be quite helpful as an alternative:

code "m9"
code "m5"
code "G28"
tool = GetSelectedTool()
SetCurrentTool( tool )
code "m1"

I just need to figure out how to implement G43 h(x) and apply the tool offset from the tool table for the new tool. 

Can somebody point me in the right direction? 




Re: M6 Macro Help
« Reply #1 on: July 14, 2013, 11:29:21 PM »
Doh!

Contents of M6Start.m1s

Code "m9"
Code "m5"
Code "g28"
Code "m1"
tool = GetSelectedTool()
SetCurrentTool(tool)
Code "g43 H" & tool

Problem solved. 

Re: M6 Macro Help
« Reply #2 on: July 15, 2013, 01:50:14 PM »
I am having some problems getting my mind wrapped around the tool offsets and the tool table.  It seems simple, but doesn't seem to work for me.  I am abandoning the G43 H(x) stuff for now.  

Just going with this for now:

Code "m9"
Code "m5"
Code "g28"
Code "m1"

Offline Graham Waterworth

*
  • *
  •  2,673 2,673
  • Yorkshire Dales, England
    • View Profile
Re: M6 Macro Help
« Reply #3 on: July 16, 2013, 03:43:06 AM »
I am not sure what it is you are trying to do, G28 on its own will do nothing useful it needs an axis commanded with it, e.g. G28 X0 or G28 Z0 to tell it which axis to home not only that but you would normally have the machine in G91 mode to stop it rapiding via the datum point first.

A normal G28 command would look something like this :-

G91 G28 X0 Y0 Z0

This will send all 3 axis to the home position in one direct move.

G90 G28 X0 Y0 Z0

Will move to the home position by going to the current XYZ zero point first then to the machines home position.

You can also use G91.1 with G28 to search for the home position.

Without engineers the world stops
Re: M6 Macro Help
« Reply #4 on: July 16, 2013, 10:06:13 AM »
Well it does do some thing.  With 12 2 0 set as the G28 position on the homing and limits page it goes to machine position 12 2 0.  This is a very convenient location to do a tool change.  It works that way.  I have tested it and it works. 

Offline Graham Waterworth

*
  • *
  •  2,673 2,673
  • Yorkshire Dales, England
    • View Profile
Re: M6 Macro Help
« Reply #5 on: July 16, 2013, 10:28:44 AM »
 :o

Without engineers the world stops
Re: M6 Macro Help
« Reply #6 on: July 16, 2013, 10:59:28 AM »
What I am trying to do is get this bit to work properly to change the indicated tool and the tool offset automatically with just an T(x) M6 command in the G-code.  This would be a superior solution to modifying my post processor to generator the extra code for tool changes. 

tool = GetSelectedTool()
SetCurrentTool(tool)
Code "g43 H" & tool

I think my problem was some confusion in setting up the tool offset table.  I think that snip of code works, but I had my tool table setup wrong.  If I have time I'll do some experiments today, but I need to make some parts first. 

As to the bit about G28 ~ Tormach shows it in their tool table setup videos also.  Interestingly they say you have to set it in on the settings page.  There is a place to enter a G28 position on the settings page, but it didn't work for me.  When I set it on the homing and limits page it worked perfectly. 
Re: M6 Macro Help
« Reply #7 on: July 16, 2013, 12:03:59 PM »
I do need to ask.  Was the surpsied face icon because I told you something you didn't know, or because my machine and setup is doing something it shouldn't? 

Offline Graham Waterworth

*
  • *
  •  2,673 2,673
  • Yorkshire Dales, England
    • View Profile
Re: M6 Macro Help
« Reply #8 on: July 16, 2013, 04:16:08 PM »
All I will say is, don't expect future versions of Mach to work that way.
Without engineers the world stops

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: M6 Macro Help
« Reply #9 on: July 16, 2013, 04:33:17 PM »
As long as there's a new manual to explain how it will work.
Right now it works as the manual says it should.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html