Hello Guest it is May 09, 2025, 09:34:50 PM

Author Topic: Edge finder probing  (Read 5306 times)

0 Members and 1 Guest are viewing this topic.

Edge finder probing
« on: November 22, 2024, 11:41:35 AM »
I have downloaded some files for edge finder which after a little works does work, what I would like is for the probe to back off 5-10 mm when it has found the edge; below is the script I use and would be grateful for ang suggestions. Cheers Tony

 
Rem VBScript To probe bottom edge
If GetOemLed (825) NE 0 Then 'Check to see if the probe is already grounded or faulty
   Code "(Probe plate is grounded, check connection and try again)"
Else
   FeedCurrent = GetOemDRO(818) 'Get the current settings
   XCurrent = GetDro(0)
   Current = GetDro(1)
   Code "G4 P1" 'Pause 1 second to give time to position probe plate
   Code "F100" 'slow feed rate to 100 mmpm
   
   Rem Probe up
   YNew = YCurrent + 75
   Code "G31 Y" &YNew
   While IsMoving()
   Wend
 
   Code "F" &FeedCurrent 'restore starting feed rate
   Call SetDro (1,Abs(getoemdro(1000))/(-2))
End If 
Rem End of To probe bottom edge script.

Offline TPS

*
  •  2,577 2,577
Re: Edge finder probing
« Reply #1 on: November 23, 2024, 03:02:47 AM »
this should do what you want:

Code: [Select]
Rem VBScript To probe bottom edge
If GetOemLed (825) NE 0 Then 'Check to see if the probe is already grounded or faulty
   Code "(Probe plate is grounded, check connection and try again)"
Else
   FeedCurrent = GetOemDRO(818) 'Get the current settings
   XCurrent = GetDro(0)
   YCurrent = GetDro(1)
   Code "G4 P1" 'Pause 1 second to give time to position probe plate
   Code "F100" 'slow feed rate to 100 mmpm
   
   Rem Probe up
   YNew = YCurrent + 75
   Code "G31 Y" &YNew
   While IsMoving()
   Wend
 
   Code "F" &FeedCurrent 'restore starting feed rate
   Call SetDro (1,Abs(getoemdro(1000))/(-2))

   'move Y Axis away ----------------------------
   Sleep(200)   
   G90wasON =GetOEMLed(48)
   Code "G91"
   Code "G1 Y-10"
   While Ismoving()
   Wend
   If G90wasON = True Then
      Code "G90"
   End If
   '--------------------------------------------------

End If
Rem End of To probe bottom edge script.


not tested just written down
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Edge finder probing
« Reply #2 on: November 23, 2024, 02:02:35 PM »
 Hi I have tried the suggestion out today and unfortunately it comes up with Scripter Compiler Error, Cheers Tony

Offline TPS

*
  •  2,577 2,577
Re: Edge finder probing
« Reply #3 on: November 24, 2024, 06:51:53 AM »
OK try this
Code: [Select]
Rem VBScript To probe bottom edge
If GetOemLed (825) Then 'Check to see if the probe is already grounded or faulty
   Code "(Probe plate is grounded, check connection and try again)"
Else
   FeedCurrent = GetOemDRO(818) 'Get the current settings
   XCurrent = GetDro(0)
   YCurrent = GetDro(1)
   Code "G4 P1" 'Pause 1 second to give time to position probe plate
   Code "F100" 'slow feed rate to 100 mmpm
   
   Rem Probe up
   YNew = YCurrent + 75
   Code "G31 Y" &YNew
   While IsMoving()
   Wend
 
   Code "F" &FeedCurrent 'restore starting feed rate
   Call SetDro (1,Abs(getoemdro(1000))/(-2))

   'move Y Axis away ----------------------------
   Sleep(200)   
   G90wasON =GetOEMLed(48)
   Code "G91"
   Code "G1 Y-10"
   While Ismoving()
   Wend
   If G90wasON = True Then
      Code "G90"
   End If
   '--------------------------------------------------

End If
Rem End of To probe bottom edge script.

the compiler error is in the original script:

If GetOemLed (825) NE 0 Then 'Check to see if the probe is already grounded or faulty


anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Edge finder probing
« Reply #4 on: November 27, 2024, 03:33:48 AM »
Hi thank you for the new suggestion, unfortunately it gave me the same result, Scripter Compiler Error.
  Cheers Tony

Offline TPS

*
  •  2,577 2,577
Re: Edge finder probing
« Reply #5 on: November 27, 2024, 06:09:22 AM »
the code is working here.

copy and paste the code into VB Scripter window
and use the ||> button to step through the code.
the VB Scripter will tell you, where the Scriper Compiler error should be.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Edge finder probing
« Reply #6 on: December 02, 2024, 07:22:49 AM »
Hi TPS thank you for your help, I have now got the edge finder working on X and Y axis in both directions. I have had to walk away and have a think about the software but now works great. Cheers Tony