Hello Guest it is April 16, 2024, 06:46:42 PM

Author Topic: Probing - what would i need?  (Read 12422 times)

0 Members and 2 Guests are viewing this topic.

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Probing - what would i need?
« Reply #40 on: April 11, 2018, 09:20:02 AM »
Thanks Rich,

I'm not too automated but I know what i want (what i really really want) and its just not giving it to me :(

I am fairly customised though.

I use the 2010 screen set and have added buttons and DRO's to that to suit my wants, I have an off-machine tool setter with on-screen DRO and a button that loads the reading into the tool table - pretty essential for me.

I have the file load routine comment out all G43 H.. lines as my M6 macros pass the tool length to the knee (C) axis at tool change, read from the tool table, essential.

The probing, I wanted to use the screen wizard for 2010 which is nice and all macro controlled. I want edge probe, surface probe, pocket probe, outside faces probe & centre etc.

Just getting a bit vexed now as i seem to have reached the limits for Mach3 - it keeps fighting back now which to me is a sign that it does not want to play any further.


Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Probing - what would i need?
« Reply #41 on: April 11, 2018, 10:36:28 AM »
ok tryed to run your posted code.
gave me scripter Compiler error:


Sleep(250) ***Needed or UserDRO's fail to update

changed it to:


Sleep(250) '***Needed or UserDRO's fail to update

then it run fine on V022 and V066

Thomas


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

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Probing - what would i need?
« Reply #42 on: April 11, 2018, 11:22:58 AM »
and yes probing drives cracy if softlimits are enabled,
so i midified your probing function a Little bit:

Code: [Select]
Sub ProbeSurface()

'*** turn soflimit's off if they are on
Dim SoftLimitswhereon As Boolean
If GetOEMLed(23) Then
DoOEMButton(119)
SoftLimitswhereon = True
End If

Sleep(250) '***Needed or UserDRO's fail to update

NotifyPlugins(10103)

SetUserDRO(1510, 0)
While(GetUserDRO(1510) = 0)
  Sleep(50)
  NotifyPlugins(10104)
Wend

If(GetUserDRO(1510) = 2) Then '***Probing error - no detection in distance = abort
  Message "Probing Error - No Surface Found"
End If

'*** turn soflimit's back on if they where on
Sleep(500)
If ((Not GetOEMLed(23)) And (SoftLimitswhereon = True)) Then
DoOEMButton(119)
End If

End Sub

ok now i will allso modify my probing libary ;)

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

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Probing - what would i need?
« Reply #43 on: April 11, 2018, 11:25:27 AM »
ok tryed to run your posted code.
gave me scripter Compiler error:


Sleep(250) ***Needed or UserDRO's fail to update

changed it to:


Sleep(250) '***Needed or UserDRO's fail to update

then it run fine on V022 and V066

Thomas




Hi

what was changed here??

:)

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Probing - what would i need?
« Reply #44 on: April 11, 2018, 11:31:36 AM »
from  ’   to   '  , sorry don't the english word for it.

copy the original code:

Sleep(250)’***Needed or UserDRO's fail to update


into notepad++, enable language VB script, and you will see the the comment is not recognized as comment.

line get's green starting from here: 's fail to update

Thomas

 
« Last Edit: April 11, 2018, 11:35:11 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Probing - what would i need?
« Reply #45 on: April 11, 2018, 11:40:55 AM »
ok made two screenshots of HexEdit , hope it makes it clearer
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Probing - what would i need?
« Reply #46 on: April 11, 2018, 11:46:19 AM »
Interesting, thanks

I'm not sure which keyboard is doing that, maybe the laptop.

Off out to retry the code.......

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Probing - what would i need?
« Reply #47 on: April 11, 2018, 11:54:37 AM »
allow me a question in own interest.

is it possible that you edited this code with a MAC?
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Probing - what would i need?
« Reply #48 on: April 11, 2018, 12:16:40 PM »
Well, sort of yes but no :)

I am using a MAC laptop running parallels and the Win7 is a virtual machine so yes its a mac keyboard but in windows mode :)

Anyway, just tried the code and it gets further but still freaked out, I added a G90 before the probe surface sub and that helped a lot.

Now it seems to have direction issues  - it will probe like this -  fast Y+, slow Y+, then instead of reversing it will jump Y+ instead of switching to Y-

Baffling

I tried increasing all the Sleep() to 200 from 50, no change

it works on your setup? Even more baffling.

I was unsure if it needed 0-variable to get a negative instead of just -variable maybe that is an issue, maybe it just sucks 100% :)

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Probing - what would i need?
« Reply #49 on: April 11, 2018, 12:45:12 PM »
Hi Dave,

i tested again this code on a V066 Setup in VB Scripter Window

Code: [Select]
Sub Main()
'***Y+ Probing Macro
'***Written by and for DD Metal Products Ltd 2018
'***Metric units only in use
'***Using CSLABS Controller M31 macro code
'***Axis scaling not expected or handled
'***Probe offset must be calibrated at "Slow Feedrate" value and set in "Probe Tip Dia" DRO first
'***Probe Z axis position is set by user first to correct height
'***Probe Y position must be within the value set in "Max Distance" DRO

Dim FeedFast, FeedSlow
Dim ProbeOffset
Dim MaxDistance
Dim X_SENSE As Double
Dim Y_SENSE As Double
Dim Z_SENSE As Double
Dim CurrentAbsInc

'***Load Variables From Screen DRO's
FeedFast = GetUserDRO(1821)
FeedSlow = GetUserDRO(1822)
MaxDistance = GetUserDRO(1823)
ProbeOffset = GetUserDRO(1829)

'TPS i do not have the DRO
FeedFast = 50
FeedSlow = 5
MaxDistance = 30
ProbeOffset = 5




'***Error checks
If GetOemLed(16)<>0 Then '***Check for machine coordinates setting
  Message "Please Change To Working Coordinates"
  Exit Sub
End If

If GetOemLed(825)<>0 Then '***Probe is not connected or cable broken
  Message "Probe Connection Error"
  Exit Sub
End If

'***Get the current G90/G91 state
CurrentAbsInc = GetOemLED(48)  


'***Start Probing
Message "Probing In Y+ Direction"
Sleep (1000)

Code "F" & Feedfast

SetUserDRO(1511, 0) '***X Axis
SetUserDRO(1512, MaxDistance) '***Y Axis
SetUserDRO(1513, 0) '***Z Axis

Call ProbeSurface()

X_SENSE = GetVar(2000)
Y_SENSE = GetVar(2001)
Z_SENSE = GetVar(2002)

Code "G91 G0 Y-3" '***Step back
While IsMoving()
  Sleep(50)
Wend

Code "F" & FeedSlow

SetUserDRO(1511, 0) '***X Axis
SetUserDRO(1512, 5) '***Y Axis - Must be within 5mm of travel
SetUserDRO(1513, 0) '***Z Axis

Call ProbeSurface()

X_SENSE = GetVar(2000)
Y_SENSE = GetVar(2001)
Z_SENSE = GetVar(2002)

'***Step back to release the probe
Code "G91 G0 Y-5"
While IsMoving()
  Sleep(50)
Wend

'***Raise the spindle to clear part
Code "G91 G0 Z10"
While IsMoving()
  Sleep(50)
Wend

'***Move Y axis to edge and zero the DRO
Code "G90 G0 Y" & Y_SENSE + ProbeOffset
While IsMoving()
  Sleep(50)
Wend
SetOemDRO(801,0)

'***Retract the spindle fully
'Code "G53 G0 Z0"
'While IsMoving()
'  Sleep(50)
'Wend

'***If G91 was in effect before then return to it
If CurrentAbsInc = 0 Then
  Code "G91"
Else
  Code "G90"
End If

Message "Y+ Probing Complete"

End Sub




Sub ProbeSurface()

'*** turn soflimit's off if they are on
Dim SoftLimitswhereon As Boolean
If GetOEMLed(23) Then
DoOEMButton(119)
SoftLimitswhereon = True
End If

Sleep(250)'***Needed or UserDRO's fail to update

NotifyPlugins(10103)

SetUserDRO(1510, 0)
While(GetUserDRO(1510) = 0)
  Sleep(50)
  NotifyPlugins(10104)
Wend

If(GetUserDRO(1510) = 2) Then '***Probing error - no detection in distance = abort
  Message "Probing Error - No Surface Found"
End If

'*** turn soflimit's back on if they where on
Sleep(500)
If ((Not GetOEMLed(23)) And (SoftLimitswhereon = True)) Then
DoOEMButton(119)
End If

End Sub



10 times in row, softlimits off, no Problem.

Thomas
« Last Edit: April 11, 2018, 12:47:13 PM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.