Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: BartDring on January 29, 2014, 01:05:22 PM

Title: Touch Plate
Post by: BartDring on January 29, 2014, 01:05:22 PM
I am trying to write a macro to zero my Z.  I want the spindle to home itself up at the limit switch, then move to a specified location, then move down to the touch plate.

Here is my macro.  It was working for a while, now it does the steps out of order.  It moves in XY before doing the G28.1 Z0


Code "G28.1 Z0"
Code "G0 X0.44 Y-0.46"
Code "G31 Z-4.0 F9"
While IsMoving()
Sleep(200)
Wend
Call SetDro (2, 0.6324)
Code "G1 Z0.8"
Code "G0 Y1"
Code "G0 Z0"

Title: Re: Touch Plate
Post by: ger21 on January 29, 2014, 02:40:38 PM
Try the code below.
If the macro is doing something it's not supposed to, try closing and restarting Mach3. If it's still acting strange, try using an older backup .xml file, as they can occasionally become corrupted and casue strange things to happen.



Code "G28.1 Z0"
While IsMoving()
Wend
Code "G0 X0.44 Y-0.46"
While IsMoving()
Wend
Code "G31 Z-4.0 F9"
While IsMoving()
Wend
Call SetDro (2, 0.6324)
Sleep (250)
Code "G1 Z0.8"
While IsMoving()
Wend
Code "G0 Y1"
While IsMoving()
Wend
Code "G0 Z0"
While IsMoving()
Wend
Title: Re: Touch Plate
Post by: BartDring on January 29, 2014, 03:50:45 PM
Thanks,

Just before I saw this I tried the isMoving after the G28.1 and it worked.  I'll add it to the other places