Welcome, Guest. Please login or register.
Did you miss your activation email?
October 19, 2017, 08:41:23 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  FAQs
| | |-+  M6 End
Pages: 1   Go Down
Print
Author Topic: M6 End  (Read 363 times)
0 Members and 1 Guest are viewing this topic.
Sandro
Active Member

Offline Offline

Posts: 4


View Profile
« on: September 30, 2017, 09:37:39 PM »

Hello Everybody,

I'm not completely new to mach3 but it is the first time asking a question as I cannot find anything to my problem. I also believe that it will be an easy fix by looking at all that knowledge out there.

Anyway. All what I want to do is to make my cnc to go to the next g-code line after a tool change rather than back to the m6-start starting position. At the moment I achieve that by creating a G0 move to the tool change position before calling a M6 tool change. Pushing START will go straight into the program rather than back to the m6-starting position. The post processor of my CAD/CAM does not add that G0-move automatically so I will have to do that by hand after reading it out.

My machine is homing to X0 Y0 Z0 in the top right corner which I offset with G54 to a plus value referring to the upper limits to my machine (for example G54 X600 Y600 Z200). Doing that will set my 0,0,0 into the front left corner and onto the machine bed. My CAD/CAM is working fine with that setting and I do not have to write minuses when hand coding. There might be a better way of achieving that but so far it worked for me.

My M6-START lookes like that:

code "F7000"
code "G53 Z-0"
code "G53 X-600 Y-600"
tool = GetSelectedTool()
SetCurrentTool( tool )

which will bring my spindle to the front left corner, easy to reach for a tool change.

I have noticed that the M6-END will call the M6-START position to set the tool up for the g-code to follow. I do not want that move and want to go straight into the g-code instead.

Ok, firstly: If there is a sound reason behind that set up move, I would like to know as I cant see one. But there might be something I don't think of, so if so please let me know.
secondly: If there is no sound reason for the doing that move than I would like to change it accordingly as I do believe that it should be easier to change M6-END then changing the post processor to add a G0 move.

Thanks for any answers
Logged
joeaverage
Active Member

Offline Offline

Posts: 1,338


View Profile
« Reply #1 on: October 01, 2017, 12:01:31 AM »

Hi,
not sure I can help, I changed over to Mach 4 so I didn't have to bother with Visual Basic...
If you have a look at the default M6End script you will see the move to the last programmed position before M6Start.
Could you not just delete, or better still comment it out?

Code:
x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
if(IsSafeZ() = 1) Then
   SafeZ = GetSafeZ()
   if  SafeZ  > z then StraightTraverse x, y,SafeZ, a, b, c
      StraightFeed  x, y,  z  , a, b, c
else
Code"G00 X" & x & "Y" & y
end if

I can think of a few situations where diving into the next lot of code is likely to cause a crash...imagine a line of code
G1 X5 Y5 Z-0.5 F50 immediately after a tool change  at  X0 Y0 Z4, ie work co-ords 0,0 with the tool 4 inches above the material.
The tool will now make a linear move to 5,5,-0.5, ie the cut is going to ramp down. Is that desired behaviour?

It sounds to me like you actually want to go to some location but without cutting, ie at SafeZ height and THEN resume your
Gcode. That's possible but will require some programming and you may find that a modification to your post becomes
attractive again.

Craig
Logged

My wife left with my best friend...
     and I miss him!
Sandro
Active Member

Offline Offline

Posts: 4


View Profile
« Reply #2 on: October 01, 2017, 12:46:58 PM »

thanks for the answer joe,

I dont wanna go to a certain position after the tool change accept the next gode.

My tool change happens at the highest Z point and away from any material. After applying the tool offset the machine can go straight into the next line

For example:

m6 t? - tool change @ x0 y0 z0 (x600 y600 z200 in machine coordinates)
g43 h? - apply tool offset without the safe z position
g0 x200 y200 - start position for the next cut
g0 z100 - rapid move to save z
g1 ...... - carry on with the next cut

if I dont put the lines g53 z0 and g0 x0 y0 in front of my tool change the controller automatically goes to the position it came from before the tool change. With a new tool in the spindle that would chrash.

I will play around with a copy of m6-end and try the thing you suggested. I cant really see that that is the answer but I will give it a go. I might also try to put the two line above into the m6-start and see what happens.

thanks
Logged
ger21
Global Moderator
*
Offline Offline

Posts: 5,575



View Profile WWW
« Reply #3 on: October 01, 2017, 01:55:02 PM »

Just leave your M6End empty.
Logged

Gerry

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

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

Offline Offline

Posts: 1,338


View Profile
« Reply #4 on: October 01, 2017, 03:47:45 PM »

Hi,
leaving M6End blank will cause the machine to drive in linear co-ordinated fashion from the toolchange position
to the endpoint of the next Gcode instruction. Is that what you want?

Craig
Logged

My wife left with my best friend...
     and I miss him!
Sandro
Active Member

Offline Offline

Posts: 4


View Profile
« Reply #5 on: October 01, 2017, 05:10:58 PM »

Yep that sounds exactly what I want. Didn't know that I could do that as it had other lines in m6end I did not understand. So I wasn't really going to touch it without clarification.

Thanks
Logged
joeaverage
Active Member

Offline Offline

Posts: 1,338


View Profile
« Reply #6 on: October 01, 2017, 05:21:08 PM »

HI,
you can comment them out, by adding the commenting the code is still there and you only
have to delete the commenting marks to get it back...if you ever want it.

Craig
Logged

My wife left with my best friend...
     and I miss him!
ger21
Global Moderator
*
Offline Offline

Posts: 5,575



View Profile WWW
« Reply #7 on: October 01, 2017, 06:20:17 PM »

Always make a backup of the file when you make any changes.
Logged

Gerry

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

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

Offline Offline

Posts: 4


View Profile
« Reply #8 on: October 02, 2017, 01:23:52 AM »

Thanks
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!