Hello Guest it is April 16, 2024, 04:16:36 AM

Author Topic: Probing from the same place  (Read 2133 times)

0 Members and 1 Guest are viewing this topic.

Probing from the same place
« on: April 02, 2020, 12:30:38 PM »
Hi.

Probably the 100 person who asks this  ;D ;)

Trying to find any information or ready g-code, macro?

I want a fixed place on the machine where the tool is measuring from all the time. So need an easy guide to this as I am brand new to this hobby, and don't want to guess anything so something breaks.


Grateful for all the help I can get 8) :)
Re: Probing from the same place
« Reply #1 on: April 02, 2020, 12:54:38 PM »
Clarification

In short, I want to be able to:
1. Mount the tool in the home position.
2. Press Auto tool zero, the machine automatically goes to fixed point and performs measurement.
3. The machine either returns home or is left waiting for orders after the completed measurement

It is a button I will use so I do not have to mount clips etc on the tool during the measurement

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Probing from the same place
« Reply #2 on: April 03, 2020, 09:28:55 AM »
to do this your machine will Need home Switches, so that it can be referenced, because a fixed Position will allways be
in machine coords.the rest is easy.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Probing from the same place
« Reply #3 on: April 03, 2020, 10:42:47 AM »
My machine already has home switches.

I found this script online that I tested in Mach3 (demo).
But I only want to use it in metric. So do not know where I change the value for it to suit me.

Dim Zprobe, Zretract, ZfeedRate
Dim PlateX, PlateY

'Note: TouchPlateHeight represents the actual height of the
' Auto Z Touch Plate from the work surface.
' Minor adjustments can be made for calibration purposes (use caution)
TouchPlateHeight = .089                                                                          <<--- values ​​in metric??

Message( "Auto Tool Zeroing..." )

If IsSuchSignal (22) Then
isMetric = GetOEMLED(801)
Zprobe = -3
Zretract = 1.5
ZfeedRate = 10
PlateX = 10                                    <<-- I guess this value needs to be changed to fit my machine?
PlateY = 10                                  <<-- I guess this value needs to be changed to fit my machine??
If isMetric = 0 Then
Zprobe = Zprobe * 25.4
Zretract = Zretract * 25.4
ZfeedRate = ZfeedRate *25.4
TouchPlateHeight = TouchPlateHeight * 25.4
PlateX = PlateX * 25.4
PlateY = PlateY * 25.4
End If
Code "G53 G0 X" & PlateX & " Y" & PlateY
Call SetDRO( 2, 0.00 )
code "G31 Z" & Zprobe & " F" & ZfeedRate
While IsMoving()
Wend
Call SetDRO( 2, TouchPlateHeight )
code "G1 Z" & Zretract
End If

Is there any other script, g-code that is more suitable for me?

Don't know anything about programming otherwise I could have figured this out

 :'( :'(

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Probing from the same place
« Reply #4 on: April 04, 2020, 03:07:35 AM »
if have cleared up the code a Little bit and made some safety checks

Code: [Select]
Sub Main()
Dim Zprobe, Zretract, ZfeedRate
Dim PlateX, PlateY

'Note: TouchPlateHeight represents the actual height of the
' Auto Z Touch Plate from the work surface.
' Minor adjustments can be made for calibration purposes (use caution)

'set all parameters in metric
TouchPlateHeight = 30                                                                         
Zprobe = -50
Zretract = 20
ZfeedRate = 10
PlateX = 10                                   
PlateY = 10                                 

Message( "Auto Tool Zeroing..." )



'check probe allready active
If GetOEMLed(825) Then
MSGBox "Probe allready activ",vbOK + vbCritical ,"Fault !"
DoButton(21)
End
End If

' go to probe position
Code "G53 G0 X" & PlateX & " Y" & PlateY

'clear z-pos
Call SetDRO( 2, 0.00 )

'do the probing
code "G31 Z" & Zprobe & " F" & ZfeedRate
While IsMoving()
Wend

'test for max trave
If GetVar(2002) <= Zprobe + 0.5 Then
MsgBox "no probe hit!",vbOK + vbCritical ,"Fault !"
End
Else
'move to contact point due overrun
Code "G90 G0 Z" &GetVar(2002)
While IsMoving()
Wend
'set z axis height
Call SetDRO( 2, TouchPlateHeight )
'go to retract position
code "G1 Z" & Zretract & "F20"
End If
'clear status line
Message " "
End Sub

it is not tested, just written down.

but i think in your case it will not do what you want to do, but you can test it and see.

this code will set the z-axis Zero allways to the top of your measuring knob, but i guess you want
to set it to your actual workpiece surface.



anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline ZASto

*
  •  423 423
    • View Profile
Re: Probing from the same place
« Reply #5 on: April 04, 2020, 04:50:43 AM »
In the attached file is what I use on my machine. One moveable plate for setting material Z0 and one fixed plate for all subsequent tools.

These codes are associated with two buttons in screenset that I use (by BlueTex, modified to suit my needs)
Make no mistake between my personality and my attitude.
My personality is who I am.
My attitude depends on who you are.
Re: Probing from the same place
« Reply #6 on: April 04, 2020, 10:53:58 AM »

Thanks so much.

I'll test these  :) :D