Hello Guest it is March 29, 2024, 03:53:31 AM

Author Topic: Using a macro to "ref all home"  (Read 12892 times)

0 Members and 1 Guest are viewing this topic.

Using a macro to "ref all home"
« on: July 11, 2018, 05: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?   

 

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Using a macro to "ref all home"
« Reply #1 on: July 11, 2018, 07:44:04 PM »
Try using G28 instead.
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Using a macro to "ref all home"
« Reply #2 on: July 11, 2018, 08: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.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Using a macro to "ref all home"
« Reply #3 on: July 12, 2018, 09:10:28 AM »
How about G28.1?
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Using a macro to "ref all home"
« Reply #4 on: July 12, 2018, 10: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   

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Using a macro to "ref all home"
« Reply #5 on: July 15, 2018, 01: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....
%
Without engineers the world stops
Re: Using a macro to "ref all home"
« Reply #6 on: July 16, 2018, 11: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   

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Using a macro to "ref all home"
« Reply #7 on: July 16, 2018, 12:18:42 PM »
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.
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Using a macro to "ref all home"
« Reply #8 on: July 16, 2018, 01: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

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Using a macro to "ref all home"
« Reply #9 on: July 16, 2018, 01: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.
Gerry

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

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