Hello Guest it is March 28, 2024, 02:21:50 PM

Author Topic: Set Z to zero automatically?Auto tool zero questions  (Read 85086 times)

0 Members and 1 Guest are viewing this topic.

Re: Set Z to zero automatically?Auto tool zero questions
« Reply #80 on: February 18, 2008, 06:26:02 PM »
Questions/problems.... sorry guys...

I don't know if it becasue I'm playing with the script on a laptop without the Mach driver installed (laptop don't have a PP so no point!) As I understand a G31, it moves the given distance, in the case here 5, unless the probe is triggered. I'm finding that it just keeps going, anyway I'll try it on the machine shortly...

Some other bits that strike me are the fact that the script puts the machine in G90 and doesn't take it out again - ok easily added, but is there a catch all "something" I dunno what, to check and store what all the active G & M codes are and then at the end after runing the script put them back as they were. 

Offline Greolt

*
  •  956 956
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #81 on: February 18, 2008, 08:21:25 PM »
La_coterie

There are many zero scripts floating around.

This is what I am currently using. It is a variation on Scotts.

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO

If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2" ' two second delay
Code "G31 Z-20 F100" 'Z goes down a max of 20mm at 100mm/min
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point
While IsMoving ()
Wend
Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
Code "G0 Z20" 'retract Z to 20 mm
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Code "F" &CurrentFeed 'Returns to prior feed rate
Else
Code "(Z-Plate is grounded, check connection and try again)"
Exit Sub
End If


This does not change any other modal settings other than the feed rate.  And that is set back to what it was before.

Greg
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #82 on: February 20, 2008, 08:42:47 AM »
Thanks for that Greg,

though there could still be cause for concern..

I've been testing these scripts just letting the G31 run to the end and of course it still thinks its done its job, I think some more scripting needs putting in there..

Another thing is that if your dro is reading a large number then G31 Z-20 is a long way before it stops - if it can get there, so that needs to be incremental. If it's not incremantal and your dro is reading smaller than -20  i.e, -100 then it goes up  ::)

 here's what I put..
>
If GetOemLed (825)=0 Then
Code "G91"
Code "(Put Plate in Position)"
Code "G4 P5" 'Time to get to the z-plate
Code "G31Z-20 F" &ProbeFeed
Code "G90"
While IsMoving()


But this assumes that the machine was in G90 state before hand and wants to go back to being G90 :-\

Is there a list of variables in Mach that hold the current active G codes? That way it can be collected before the start of the macro & put back after the macro

There's gonna be that day when you're not using abs and it's bound to be an expensive tool/job  :'(

Shoving different numbers in the dro and trying out the macro usually works  ??? I can't put my finger on what exactly how to replicate it but stepping through the macro I found that when it goes haywire it hasn't updated the ZProbePos variable, I'll try some more to make it repeatable but early tests seem to indicate that it screws up if I don't jog the Z axis after changing the dro.....  oh ver 3.0 arts last :)

Has anybody else had this?

Steve
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #83 on: February 20, 2008, 01:27:42 PM »
 :-[  Whoops, my error  ::) on the lack of updating the ZProbePos ..I had OEM trig 1 set to the same pin for cycle start. 
I should have guessed that when I saw the start led flashing at the same time as the probe led  ::)  but I figured it was another mach "feature"  ;D
Steve

Offline Greolt

*
  •  956 956
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #84 on: February 20, 2008, 03:27:20 PM »

Another thing is that if your dro is reading a large number then G31 Z-20 is a long way before it stops - if it can get there, so that needs to be incremental.

If it's not incremantal and your dro is reading smaller than -20  i.e, -100 then it goes up  ::)




That's what this line is for,    DoOEMButton (1010) 'zero the Z axis so the probe move will start from here

This zeros the Z DRO before the move.  So does not matter if it is incremental or absolute.     No need for G90  or G91

Greg
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #85 on: March 30, 2008, 05:15:34 AM »
Greg,

In an earlier post you made a screen file OLFlaser.set available for download. I have tried this offline in MACH and I have a question. This screen set has a button AUTO TOOL ZERO but I am unsure of the purpose of this button and it's script. I think I wrongly assumed that it would auto zero the Z but  is not a script as you have included in your post above. Since the LASER ZERO F12 is setup to move the spindle (tool center) to the point that was jogged to using the laser, I am not sure what the purpose of this button is? To be fair, I don't yet have a LASER CROSS HAIR (just bought 2 on ebay) nor do I have a Z zero  set plate yet so I am not actually performing the moves just trying to under stand the logic/scripting. Appreciate your comments. My ultimate goal is to get the LASER CROSSHAIRS and AUTO Z SET working with a new SHUTTLEPRO jog pad that I hope to pick-up tommorrow.

Cheerio
Gerald
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #86 on: March 30, 2008, 10:20:32 AM »
Hi to all,
I've been following all the developments on this post and have one question about an option that I have not seen yet. Is it possible to call this macro for zeroing the Z axis by means of pushing a pre-programmed button on the device (pendant, joystick, MPG or what have you) that it used for jogging or fine posisioning? Also along the same lines - Could the same be applied for calling the "video window" (from the PlugIn Control) which is used to center the cutter in the X and Y axii? I'm not much of a guru in this area so pardon me if I'm talking nonsense.
Regards
Marten

Offline Greolt

*
  •  956 956
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #87 on: March 31, 2008, 04:55:59 AM »
Hi to all,
I've been following all the developments on this post and have one question about an option that I have not seen yet. Is it possible to call this macro for zeroing the Z axis by means of pushing a pre-programmed button on the device (pendant, joystick, MPG or what have you) that it used for jogging or fine posisioning? Also along the same lines - Could the same be applied for calling the "video window" (from the PlugIn Control) which is used to center the cutter in the X and Y axii? I'm not much of a guru in this area so pardon me if I'm talking nonsense.
Regards
Marten

G'day Marten

Yes the "Auto Tool Zero" script can be called via a Shuttle Pro.  Mach has a plugin for this device.

As far as Joysticks etc.  There are plugins available but I have not used them.

Also any device that uses "KeyGrabber" will do it.

I don't know if the Video Window can be activated by a button press.  I have not tried to do this.

Greg

Offline Greolt

*
  •  956 956
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #88 on: March 31, 2008, 04:59:01 AM »
Greg,

In an earlier post you made a screen file OLFlaser.set available for download. I have tried this offline in MACH and I have a question. This screen set has a button AUTO TOOL ZERO but I am unsure of the purpose of this button and it's script. I think I wrongly assumed that it would auto zero the Z but  is not a script as you have included in your post above. Since the LASER ZERO F12 is setup to move the spindle (tool center) to the point that was jogged to using the laser, I am not sure what the purpose of this button is? To be fair, I don't yet have a LASER CROSS HAIR (just bought 2 on ebay) nor do I have a Z zero  set plate yet so I am not actually performing the moves just trying to under stand the logic/scripting. Appreciate your comments. My ultimate goal is to get the LASER CROSSHAIRS and AUTO Z SET working with a new SHUTTLEPRO jog pad that I hope to pick-up tommorrow.

Cheerio
Gerald

Gerald

I have no recollection of the screen set you refer to.  I have posted a few variations at peoples request.

However the "Laser Zero" button would be as you said.

The "Auto Tool Zero" button should run a button script with the script as has been posted above.  Or a close variation of it. :)

Greg

Offline astr

*
  •  30 30
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #89 on: September 24, 2009, 01:18:44 PM »
I read through this thread several times and it appears that this is exactly what I want: a Z-axis auto-zero function using an additional button and user DRO's on the main Mach3 screen.  I got the probe wired up, enabled it in Mach3 and Mach3 seems to recognize a "touch". 

The harrdware and configuration seem to be OK but I get lost as how to modify the screen to add the buttons and DRO's and how to install the scrtipt behind these.  I've played with Screen4 a bit.  I kind of undrestand some of the scripts that are posted earlier in this thread but somehow I'm missing the actual steps necessary to put all the pieces together.

Could someone point me in the right direction?  Please use small words and short sentences as I get confused easily ;D ;D