Hello Guest it is June 23, 2025, 11:33:33 PM

Author Topic: Problem with Probe Z input  (Read 9688 times)

0 Members and 1 Guest are viewing this topic.

Problem with Probe Z input
« on: August 17, 2023, 11:52:14 AM »

Hello,

  Thanks in advance.
When I run a "Z probe" script, after the tool has touched and moved back, I have to touch the sensor again if I want to move the machine again. It does allow me to run the Z search script again but not move manually until I force the input assigned to probe Z to give a new signal. I hope I have explained myself.
Thank you!

Offline Graham Waterworth

*
  • *
  •  2,783 2,783
  • Yorkshire Dales, England
Re: Problem with Probe Z input
« Reply #1 on: August 17, 2023, 09:40:37 PM »
It sounds like a buggy script, post it here for us to take a look at it.
Without engineers the world stops
Re: Problem with Probe Z input
« Reply #2 on: August 18, 2023, 01:50:32 PM »
Hello,


I have already been able to find out what was happening. I indicate it in case you can verify that the solution is correct.
The problem was that if the script ended without forcing a new signal on the probe, Mach3 would stay in "MPG JOG" mode. I have a "WHB04B-4: 4 Axis manual Pulse generator" RF that doesn't seem to need this mode (if you can explain to me what MPG is for). Reviewing the MACH3 configuration I saw that it had MPG#1 enabled in the ports and pins configuration. I have removed the enable and then when I run the program it no longer switches to MPG JOG mode.

Thanks!



My script is:

'-------------------
Dim PlateHeight As Double, FeedCurrent, ZPosCurrent As Double

'PlateHeight = getoemdro(1001) ' Get Plate Height (Mach3 Plate height)
PlateHeight = getoemdro(1151) ' Get Plate Height (Darkscreen PlateHeight)
FeedCurrent = GetOemDRO(818) 'Get the current settings

If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty
  Code "(Probe plate is grounded, check connection and try again)"
Else
  ' ###### Probe Z- ######-
  ZPosCurrent = GetDro(2) 'Get current position
  Code "F100" 'slow feed rate to 100 mm/min

  Code "G31 Z" & (ZPosCurrent - 25) 'probe 25mm down
  While GetOemLed (825) = 0
    Sleep(1)
  Wend

  Sleep(250) 'Wait for DRO to update

  Call SetDro (2, PlateHeight) 'Set the Dro

  Sleep(250) 'Wait for DRO to update
   
  Code "G0 Z" & (GetDro(2) + Abs(10)) & " F400" 'Move off the plate 10mm
  While IsMoving()
  Wend

  Code "(Z Axis Zeroed for PlateHeight:" & PlateHeight & ")"
  Code "F" & FeedCurrent 'Restore Feedrate
End If

Call WaitProbeReady()

Exit Sub
 
 
Sub WaitProbeReady()
   While GetOemLED(825)
      Sleep(100)
   Wend
End Sub