Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: satchid on February 18, 2006, 11:41:56 AM

Title: Prope set script
Post by: satchid on February 18, 2006, 11:41:56 AM
Hi Brian,

You liked it in here?

I am trying to used the toolset macro of the file section.

The problem is that the Z axis refuses to set to anything other than the original set position. Electronically everything works fine, the z movement stops when the tool touches the top of the probe-plate and then returns to the home position.

Here is what I do:
I home the z axis
I set then tool to close to the top of the work peace and re-zero z Then lift the z and place my 15mm probe plate on top of my work piece Then run the script. The setting in the z DRO is not changing.
When I run "GOTO Z" the probe is going to the originally set 0 position close to the work piece as set in the beginning.

Then I step trough the program,

When the probe stops at the top of my probe, then I then put 15 in the z DRO and run the rest of the program, it stays like that and the top of the work peace is set to 0.

So what am I doing wrong?

I inlude what I am using here:

Zmove = 1.5
Zpos = GetDRO(2)
Tool = GetDRO (24)
ZOffset = GetVar (1000)

If Tool = 0 Then
   Response = MsgBox ("Did you zero off the part First?", 4 , "Set up offset")
   If (Response = 6) Then ' Yes
   ZPos = Zpos - ZMove
   Code "G31 Z" & ZPos & " F20.0"
   While IsMoving()
   Wend
   Zpos = GetVar(2002)
   Call SetVar (1000,ZPos)
   
   Else
   MsgBox "Set zero on the top of the part and run again"
   End If
   
Else
   
   OldZpos = Zpos
   ZPos = Zpos - ZMove
   Code "G31 Z" & ZPos & " F20.0"
   While IsMoving()
   Wend
   Zpos = GetVar (2002)
   Code "G00 Z" & Zpos
   While IsMoving()
   Wend
   If Zpos = OldZpos - ZMove Then
      responce = MsgBox ("ERROR! The tool did not hit the probe and DRO was not set" , 4 , "Probe ERROR!" )
   Else
      SetDRO (2,ZOffset)
   End If
   

   
End If
Code "G00 G53 Z-.1"





 

 


Thank you,

Willy

Title: Re: Prope set script
Post by: ftissera on February 18, 2006, 01:16:31 PM
Hello satchid,

try my Button "Auto Toll Zero" script:
My Spindle homed up=Z0
My Zmax=-80mm you have to adapt !

***********

REM Context 10001

if IsSuchSignal (22) Then
code "G31 Z-80 F150"
While IsMoving()
Wend
call SetDRO( 2,  15 )
code "G0 Z16"
While IsMoving()
Wend
end if

***********
Usage:
place the probe under the tool and press "Auto Toll Zero" button
the spindle up 1mm (16-15) for removing the probe.

Hope that help  :)
Francis
Title: Re: Prope set script
Post by: satchid on February 18, 2006, 07:15:31 PM
Thank you Francis

But, I am not long in CNC and have no knowledge of scripting. So I do have a number of questions.
Where do I get the "Auto Toll Zero" button? Or how do i create it?
How do I connect the program to the button or the button to the program?

Sorry for so much ignorance, but it is allot to learn at once in CNC. I consentrate on the cutting at the moment.

if IsSuchSignal (22) Then      'What is signal (22) 

Thanks

Willy
Title: Re: Prope set script
Post by: ftissera on February 18, 2006, 07:59:47 PM
Satchid,
take a look at:
http://www.machsupport.com/MachCustomizeWiki/index.php?title=Main_Page

It's a big source of information  :)

Good luck
Francis
Title: Re: Prope set script
Post by: Brian Barker on February 19, 2006, 08:02:54 AM
This script is for running a probe off the side of the part. I wrote that some time ago as an example of how you could write a probe macro. SO I think it would be best if we write you a new cycle that will work the way you would like.
Title: Re: Prope set script
Post by: Brian Barker on February 19, 2006, 08:11:23 AM
Try this :

Zmove = 1.5 'amount the tool will move down to hit the probe
Zpos = GetDRO(2)
Tool = GetDRO (24)
ZOffset = .5 'enter height of probe here

   OldZpos = Zpos
   ZPos = Zpos - ZMove
   Code "G31 Z" & ZPos & " F20.0"
   While IsMoving()
   Wend
   Zpos = GetVar (2002)
   If Zpos = OldZpos - ZMove Then
      responce = MsgBox ("ERROR! The tool did not hit the probe and DRO was not set" , 4 , "Probe ERROR!" )
   Else
      SetDRO (2,ZOffset)
   End If
   
Code "G00 G53 Z-.1"

To use it place the probe under the tool and press the button (the first time press it with your finger off to the side) please see the notes in the macro

Thanks
Brian
Title: Re: Prope set script
Post by: ftissera on February 24, 2006, 12:59:16 PM
Try this :

.....
   Zpos = GetVar (2002)
.....

Brian

Hello Brian,
please where is the Param List you have found 2002 number ? I do not find it in Wiki !

Thanks
Francis
Title: Re: Prope set script
Post by: Brian Barker on February 24, 2006, 07:21:01 PM
The probe writes to 2000 = X 2001= y adn 2002 = z

I am off to add it to the Wiki