Hello Guest it is October 14, 2019, 07:42:11 AM

Author Topic: M6Start.m1s & M6End.m1s - how do I modify? (to so something very simple!)  (Read 8226 times)

0 Members and 1 Guest are viewing this topic.

Maybe I work differently to everone else, as I'm not finding a whole lot about what I'd like to do?!!

All I want is for every time a tool change is triggered, for the Z plane to move up 50mm.

I then stop the spindle manually
Change the tool manually
start the spindle manually
The press cycle start

At this point I would like the spindle to movedown 50mm again & carry on where it left off from a Z axis location perspective.

(I'm going to set up all my cutter with rings to ensure the distance to the tip is the same for all of them)

Many thanks for any help you can give.

Now I know the Macros M6Start.m1s & M6End.m1s will need some editing - but what to put in there to ahve that very simple up/down 50mm move happen?

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
OK, i poked around and this seems to work. Just change the M6 start to this:

tool = GetSelectedTool()
SetCurrentTool( tool )
code"G0 Z50"

Make sure in general config, you set the tool change to stop spindle and wait for cycle start.
Gerry

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

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

Offline Hood

*
  •  25,855 25,855
  • Carnoustie, Scotland
    • View Profile
Heres what I came up with, now be warned, I am not the best at VB so try this with caution ;)
In your M6Start.m1s put the following

  tool = GetSelectedTool()
  SetCurrentTool( tool )
 
  Code ("G91G0z50")
  While IsMoving()
  Wend
  Code("G90")
  While IsMoving()
  Wend
  DoOemButton(1003)

In your M6End.m1s put the following

If GetOemLED(1000) Then
 Code("G91G0Z-50")
  While IsMoving()
  Wend
  Code("G90")
  While IsMoving()
  Wend
  End If 

You will also need to change the setting on General Config page to Auto Toolchanger.

Hood
« Last Edit: March 01, 2010, 07:32:25 PM by Hood »
Many thanks guys.

Gerrythat works a treat - very simple too!

Hood - not tried yours yet (your post came in too late for me to try last night!) - it looks a lot more complicated ...is there any extra win in there vs the simple entry that Gerry posted up? (I can't tell!)


Just a passing thought - until I get depth rings on *all* my cutters, I can't really use this procedure - is there a way of getting the tool to raise 50mm  (triggered by a tool change) and then drop say 30mm after I've finished changing to the tool? (this would at least save me a lot of jogging, the 30mm drop allows me then find Z0 manually after a tool change)

Thanks once again guys.

Offline Hood

*
  •  25,855 25,855
  • Carnoustie, Scotland
    • View Profile
Gers way will just move to work offset Z50 rather than actually move 50mm up, eg if you are at Z20 when you do a toolchange  it will just move up 30mm. Also it will not move back down again after you press start, it will just do the next line of code, so for example if the next line was G1Z-2F30 it would move down from Z50 at 30mm/min.
The code I posted will move in incremental units on the Z so it will raise up 50mm from wherever the Z is then when you press start it will rapid down  Z50 then your code will take over.
 Not sure which way you were wanting it but I was thinking you were wanting the actual 50mm movement?
To change the distance it moves back down just change the line in the M6End.m1s from  Code("G91G0Z-50") to  Code("G91G0Z-30") but if you were then going to then jog down and rezero the Z DRO you would need to have a stop in the M6End macro like is in the M6Start one so that the code stops after the toolchange is complete.

Hood
« Last Edit: March 02, 2010, 05:18:41 AM by Hood »
Hi Guys,

Just caught in on this discussion. I think i must be really stupid because i cant seem to get my m6 start to work. I have written/modified a script for m6, which works perfectly in the script editor, i change the tool number hit debug and my auto toolchanger will locate the tool. When i try with the script editor closed nothing will happen, The command M6 T4 for example pulls up an error handling section of my program when it doesn't with the script editor open?? What is the normal procedure to select a tool in mach3 turn manual mode?

Many Thanks,

Adam

Offline Hood

*
  •  25,855 25,855
  • Carnoustie, Scotland
    • View Profile
T0606 or alternatively T606 would be the call for tool 6 offset 6

Hood