Welcome, Guest. Please login or register.
Did you miss your activation email?
July 19, 2018, 04:17:00 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  G-Code, CAD, and CAM
| |-+  G-Code, CAD, and CAM discussions
| | |-+  Using a macro to "ref all home"
Pages: 1 2 »   Go Down
Print
Author Topic: Using a macro to "ref all home"  (Read 164 times)
0 Members and 1 Guest are viewing this topic.
KipKirol
Active Member

Offline Offline

Posts: 8


View Profile
« on: July 11, 2018, 04:25:25 PM »

I have created a macro to "ref all home"    A quick and easy safety step I am adding since our machine has lost position in the Y and Z axis, causing catastrophic table damage (working with a 15" cutter head here)

I am using M12, and the macro rads as follows:

DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )

DoOEMButton(133)
DoOEMButton(134)
DoOEMButton(135)


The above is just a copy of the "ref all home" button script.   We only use the Y and Z axis so the extra buttons are not necessary but dont seem to have an affect.

When I go to MDI and type in M12 the machine responds as if I have pushed "ref all home" exactly as I had intended.

When I add the M12 into a program and load into Mach3, the controller stops "generating toolpath" when it arrives at the M12 line and just waits for me to click cancel.   If I run the program, the machine runs through the header to the M12, does the homing move, and starts at the top of the program.   I think if I left it, it would just repeat this forever.    Here is what my header looks like:

G21                           
G90                           
G53         Z   0               
T1 M6                           
G0 G90 G54   Y   -79                     
M12                           
G0   Y   -79                     
                     S   3250   M3
G43 H1         Z   15               
G1                F   250   



Any ideas how I can make this work?   

 
Logged
ger21
Global Moderator
*
Offline Offline

Posts: 5,863



View Profile WWW
« Reply #1 on: July 11, 2018, 06:44:04 PM »

Try using G28 instead.
Logged

Gerry

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

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

Offline Offline

Posts: 8


View Profile
« Reply #2 on: July 11, 2018, 07:09:01 PM »

When I use a G28 it moves the axii to their home position but does not touch off the limit switches.   So if the machine has lost position a G28 will not bring it to the correct home position.
Logged
ger21
Global Moderator
*
Offline Offline

Posts: 5,863



View Profile WWW
« Reply #3 on: July 12, 2018, 08:10:28 AM »

How about G28.1?
Logged

Gerry

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

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

Offline Offline

Posts: 8


View Profile
« Reply #4 on: July 12, 2018, 09:51:25 AM »

Here is a header with G28.1 for the Y and Z      I tested G28.1Y0 and G28.1 Z15 in MDI and standing alone they both work fine.     

However when running the code, the machine gets stuck on the G28.1 Z15 line.     It rapids down to 15 and slowly touches off the limit switch twice as if it were homing then it rapids to 15 and just does this repeatedly.   The Zero Z button never goes from red to green (it was green/homed when starting the file)

When I delete the G28.1 Z15 line it then goes to the G28.1 Y0 line and acts similarly, never moving on on the program.



G21                           
G90                           
G53         Z   0               
T1 M6                           
G0 G90 G54   Y   -79                     
G28.1         Z   15               
G28.1   Y   0                     
G0   Y   -79                     
                     S   3250   M3
G43 H1         Z   15               
G1                F   250   
Logged
Graham Waterworth
Administrator
*
Offline Offline

Posts: 1,825


West Yorkshire, England



View Profile WWW
« Reply #5 on: July 15, 2018, 12:26:42 PM »

On my machines I do it this way :-

%
G21 G40 G49 G80
G91 G28.1 Y0 Z0

N1(TOOL 1)
T1 M6                           
G54 G00 G90 Y-79                                   
S3250 M3
G43 H1 Z15               
G1 F250   
Etc....
%
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
KipKirol
Active Member

Offline Offline

Posts: 8


View Profile
« Reply #6 on: July 16, 2018, 10:51:13 AM »

I think I am missing something simple here - Graham I tried using part of your code in my header and I got the same result that I described above - the machine touches off the Y and Z limit switches and rewinds the program and does this indefinitely.   Am I missing a command to to continue or something like that?         Here is what I am working with - (the program wont advance passed line 6 (G91 G28.1 Y0 Z0) and instead rewinds to the beginning of the program

G21                           
G90                           
G53         Z   0               
G0 G54   Y   -79                     
G21 G40 G49 G80
G91 G28.1 Y0 Z0                  
G90 G0   Y   -79                     
T1 M6                     S   3250   M3
G43 H1         Z   15               
G1                F   250   
Logged
ger21
Global Moderator
*
Offline Offline

Posts: 5,863



View Profile WWW
« Reply #7 on: July 16, 2018, 11:18:42 AM »

What version of Mach3?

Are you using the parallel port, or a motion controller?

It could be a Mach3 bug, or that your motion controller does not properly support G28.1.
Logged

Gerry

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

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

Offline Offline

Posts: 8


View Profile
« Reply #8 on: July 16, 2018, 12:12:10 PM »

Mach 3 Version 3.043.066

Using a USB to this card -
Mach3 XHC MK4-IV   

Paid for the software and controller with purchase of our machine
Logged
ger21
Global Moderator
*
Offline Offline

Posts: 5,863



View Profile WWW
« Reply #9 on: July 16, 2018, 12:57:41 PM »

I would try version 3.043.062, as .066 is known to be buggy.

And the chinese motion controller may be the issue, as most if not all chinese controllers have some issues with Mach3 functions.
Logged

Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Pages: 1 2 »   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!