Hello Guest it is April 19, 2024, 07:14:25 AM

Author Topic: Tool Change Pause Question  (Read 6216 times)

0 Members and 1 Guest are viewing this topic.

Tool Change Pause Question
« on: September 09, 2007, 07:40:43 PM »
I have a simple macro to do tool changes, the code is as follows:

x = GetUserDRO( 1200 )
y = GetUserDRO( 1201 )
z = GetUserDRO( 1202 )

code" G53 G0 Z" & z

While IsMoving()
Wend

code" G53 G0 X" & x & "Y" & y

While IsMoving()
Wend

SystemWaitFor (Start)

tool = GetSelectedTool()
SetCurrentTool( tool )
 

If I pull out the 'SystemWaitFor (Start)', the tool change macro never pauses, it homes and then heads right back out. If I leave it as shown it does work but I have to hit the stop and then the start button, I thought the M6 start and end macro's automatically paused or was I mistaken?

What I want to be able to do is pause in the macro, change out my tool, reset the height if needed and then when I hit the start button have it take off again. Maybe I can send a stop using the script?

This should be an easy one :)

-Paul-
-Paul-

Paul Davis
Luthier
Patriot Guitars
Re: Tool Change Pause Question
« Reply #1 on: September 10, 2007, 01:39:02 PM »
I found an odd thing while playing with this (sometimes you have to use these in a real situation to find these things), using the code above unchanged, the machine homes and then waits for the stop and start buttons and takes off from where it is at X&Y (I.E. That being my tool change location) instead of going back to the original position it was at.

I'm assuming that I need to pick up the X&Y before I start the macro and then send it back after the SystemWaitFor (Start), I thought for sure I had this working, it's always the simple things that cause the most problems :)

-Paul-
-Paul-

Paul Davis
Luthier
Patriot Guitars

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Tool Change Pause Question
« Reply #2 on: September 11, 2007, 08:35:13 AM »
Not quite sure what your wanting to do really,

but, just use the "stop spindle wait for cyctle start" radio button under general config...... when Mach sees a tool change, it will stop the spindle, and stop. you can then adjust what ever you want, then continue from the new point, since unless you have tool holders, your gonna have to touch off Z anyway.
fun times

vmax549

*
Re: Tool Change Pause Question
« Reply #3 on: September 11, 2007, 02:11:12 PM »
Paul you need to record the last work position in a set of UserDros. Then you have somewhere to return back to after the tool change.

You also need to go to the tool change position by way of the M6start macro and then return to work via the M6end macro

That way you have the pause in between to do the tool change out.

I have some code that will do close to what you want I'll look it up and post it.

(;-) TP
Re: Tool Change Pause Question
« Reply #4 on: September 11, 2007, 02:27:51 PM »
That would be Awesome TP, it is working kind of, but I wasn't sure what the second macro was for. I did add some code to get the current position and return back but I did it all in the M6Start macro, your idea sounds better to me.

Thanks for the help, I look forward to seeing the macro's...

-Paul-

Paul Davis
Luthier
Patriot Guitars

vmax549

*
Re: Tool Change Pause Question
« Reply #5 on: September 11, 2007, 02:48:27 PM »
Paul here is one example.   IT can be done MANY, MANY different ways. (;-) I hope it helps give you the idea.

 
(M6start)


 tool = GetSelectedTool()
  SetCurrentTool( tool )

  Xpos= getoemdro(83)
  Ypos= getoemdro(84)
  Zpos= getoemdro(85)
  Feed= Getdro(18)
 
 
  Setoemdro(1200,Xpos)
  setoemdro(1201,Ypos)
  Setoemdro(1202,Zpos)


  Code "G53 Z0 F60"
  While Ismoving()
  Wend

  Code "G53 Y-10 "
  While Ismoving()
  Wend         


  Code "G53 X-14 "
  While Ismoving()
  Wend   
 
  Setdro(18,Feed)
 
  Dooembutton(99)   
 
  End   

=================================================================


(M6end)
Yreturn= getuserdro(1201)
Xreturn= getuserdro(1200)
Zreturn= getuserdro(1202)

Feed= Getdro(18)


Code "F60"
code"G53 X"&xreturn
While Ismoving()
Wend
Code"G53 y"&yreturn
While Ismoving()
Wend
COde"G53 z"&zreturn
While Ismoving()
Wend
Setdro(18,Feed)

END


   

       
« Last Edit: September 11, 2007, 02:51:47 PM by vmax549 »
Re: Tool Change Pause Question
« Reply #6 on: September 11, 2007, 03:03:07 PM »
Interesting... so your storing those values in the tool change position DRO's, hadn't thought of that actually. I supposed it doesn't matter since I actually always come to the same location for a tool change, so that I could just hard code in. I was waiting to see how you stored the values from one macro to the other....

I'll give this a wirl as soon as I get home and see how it works...

Thank you :)

Cheers

-Paul-
-Paul-

Paul Davis
Luthier
Patriot Guitars

vmax549

*
Re: Tool Change Pause Question
« Reply #7 on: September 11, 2007, 04:47:08 PM »
Also plan out the general direction of your move to and from the tool change position. It may seem strange to move each axis independly but by doing so I always know the general direct it will travel in. It helps to avoid future obstructions(crashes)

(;-) TP

vmax549

*
Re: Tool Change Pause Question
« Reply #8 on: September 11, 2007, 06:26:59 PM »
One other thing you will want to delete out the call to the oembutton(99) that is used to call up a tool change page that is basically a giant flashing LED along with the required tool change info. That way I know what tool is suppose to run next and I can see it across the shop flashing yellow.
(;-) TP
Re: Tool Change Pause Question
« Reply #9 on: September 11, 2007, 08:46:58 PM »
Ok so I get the forrest gump award for the year, I called Bret about the Z problem with the machine going up and slamming the switch... It turns out that at some point I changed the tool change to auto instead of Stop Spindle and wait, I also set the safe Z as suggest by vmax and then changed my macro to this:

x = GetUserDRO( 1200 )
y = GetUserDRO( 1201 )
z = GetUserDRO( 1202 )

code" G53 G0 Z" & z

While IsMoving()
Wend

code" G53 G0 X" & x & "Y" & y

While IsMoving()
Wend

Bingo!!! that did the trick, in fact the machine is cutting parts right now (man is it loud!!!)....

Thanks to Brett and vmax for the help, turns out I was just having one of those weeks..... :)

-Paul-
-Paul-

Paul Davis
Luthier
Patriot Guitars