Hello Guest it is March 24, 2025, 07:53:22 PM

Author Topic: Intermittent CNC Probe Issue  (Read 15912 times)

0 Members and 1 Guest are viewing this topic.

Intermittent CNC Probe Issue
« on: December 26, 2024, 05:00:35 AM »
Hello everyone, and Merry Christmas! 🎄

I need your help with an issue I’m experiencing with my CNC probe. When I run a probing cycle, the tool correctly descends until it touches the probe, but instead of retracting to the set distance, it continues to descend, risking damage to the probe.

The problem is quite random: probing can work perfectly for about twenty cycles, but on the 21st attempt, the tool unexpectedly keeps descending. I’ve recorded a video to show the issue: https://www.youtube.com/shorts/nm7uXgvbTuI.

To troubleshoot, I updated my version of Mach3 (from 3.043.066 to 3.043.062), as the latter is known to be more stable. This has slightly improved the situation, but the issue still occurs occasionally.

Does anyone have an idea of what might be causing this behavior or any suggestions for resolving it? Thank you in advance for your help! 😊

Bobi
Re: Intermittent CNC Probe Issue
« Reply #1 on: December 26, 2024, 09:45:19 AM »
Could you post the code? Mach3 or 4? 

Strictly that's a touch plate or button rather than probe but what's in a name?
Re: Intermittent CNC Probe Issue
« Reply #2 on: December 26, 2024, 10:08:12 AM »
Hi Hohn,

Thank you for your response.

Could you post the code? Mach3 or 4? 

Strictly that's a touch plate or button rather than probe but what's in a name?

I am using Mach 3. Here is the code:
VPALP = GETOEMDRO(1060)
HPALPEUR = GETOEMDRO(1040)
HSURFACE = GETOEMDRO(1050)
NOUVEAUZ = HPALPEUR+HSURFACE
HFIN = GETOEMDRO(1051)
If HFIN < NOUVEAUZ Then
HFIN = NOUVEAUZ
SETOEMDRO(1051,HFIN)
End If
CODE "G31 Z-200 F"& VPALP
While ISMOVING()
Wend
SLEEP(250)
ZPALP = GETOEMDRO(802)
SLEEP(250)
CODE "G00 Z"& ZPALP
While ISMOVING()
Wend
SETOEMDRO(802,NOUVEAUZ)
SLEEP(250)
CODE "G00 Z"& HFIN
While ISMOVING()
Wend

It's a probe with just a plate connected to the PCB. There is nothing mechanical. Here is the photo :
https://ibb.co/DYXZLMr
Re: Intermittent CNC Probe Issue
« Reply #3 on: January 02, 2025, 09:01:16 AM »
No One has an idea ? :)

Offline TPS

*
  •  2,561 2,561
Re: Intermittent CNC Probe Issue
« Reply #4 on: January 02, 2025, 01:04:15 PM »
in your case this part of code:

Code: [Select]
ZPALP = GETOEMDRO(802)
SLEEP(250)
CODE "G00 Z"& ZPALP
While ISMOVING()
Wend

is complete useless

in some cases a G90 G31 Z-200 can be helpfull

« Last Edit: January 02, 2025, 01:08:26 PM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline Graham Waterworth

*
  • *
  •  2,773 2,773
  • Yorkshire Dales, England
Re: Intermittent CNC Probe Issue
« Reply #5 on: January 05, 2025, 12:57:16 PM »
Try the code like this, Mach3 can be very fussy about Sleep commands.  Add the Declare Sub line to make sure its using the correct time length.

Rule of thumb is :-

If moving then sleep in a loop with a short time 25 to 50 m/s.

If updating DRO's or system variables then NO loop 50 to 100 m/s time is good.


Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
VPALP = GETOEMDRO(1060)
HPALPEUR = GETOEMDRO(1040)
HSURFACE = GETOEMDRO(1050)
NOUVEAUZ = HPALPEUR+HSURFACE
HFIN = GETOEMDRO(1051)
If HFIN < NOUVEAUZ Then
HFIN = NOUVEAUZ
SETOEMDRO(1051,HFIN)
EndIf

CODE "G31 Z-200 F"& VPALP
While ISMOVING()
Sleep(50)
Wend

ZPALP = GETOEMDRO(802)
SLEEP(50)

CODE "G00 Z"& ZPALP
While ISMOVING()
Sleep(50)
Wend

SETOEMDRO(802,NOUVEAUZ)
SLEEP(50)

CODE "G00 Z"& HFIN
While ISMOVING()
Sleep(50)
Wend


For reference here is part of my spindle probe code for finding the top of the work, it will give you some ideas on how the code needs to be.

'Spindle Probe - Top Face Only
Code "G" & 53 + Current_Fixture
'Lets try probing the Z surface
If GetOemLed(825) = 0 Then
   'Fast move
   Point = Move + Overrun
   Code "G49"
   Code "G31 G91 Z-" & Point & " F" & ProbeFastFeed
   While IsMoving()
     Sleep(50)
   Wend
   If GetOemLed(825) Then
     'We have a hit retract and check again
      Code "G00 G91 Z" & FirstRetract
      While IsMoving()
        Sleep(50)
      Wend
      Sleep(100)
      'Slow move
          Point = FirstRetract + Overrun
           Code "G31 G91 Z-" & Point & " F" & ProbeSlowFeed
           While IsMoving()
                   Sleep(50)
           Wend
           If GetOemLed(825) Then
        'Small retract
        Code "G00 G91 Z" & SecondRetract
        While IsMoving()
          Sleep(50)
        Wend
        'Sleep(100)
        'Creep move
         Point = SecondRetract + Overrun
                Code "G31 G91 Z-" & Point & " F" & ProbeCreepFeed
              While IsMoving()
                 Sleep(50)
              Wend
              Sleep(100)
         Z_ProbePos = GetVar(2002)
         Sleep(100)
         Call SetDro(2,0)
         Code "G4 P0.5"
         Code "G00 G91 Z" & Move
         While IsMoving()
           Sleep(50)
              Wend
            Else
         Code "(No face found, 2nd probing cancelled)"
              Exit Sub
                 End If
  Else
    'No face found
    Code "G00 G91 Z" & Move + Overrun
    While IsMoving()
      Sleep(50)
    Wend
    Code "(No face found, 1st probing cancelled)"
  End If
Else
  Code "(Probe is triggered or obstructed, cancelled probing)"
  Exit Sub
End If


« Last Edit: January 05, 2025, 01:07:00 PM by Graham Waterworth »
Without engineers the world stops
Re: Intermittent CNC Probe Issue
« Reply #6 on: January 06, 2025, 05:01:24 AM »
@Graham Waterworth

Thank you for your answer and for sharing your code.

At the same time, I contacted the manufacturer of the XHC card.
He told me that the problem could be due to the probe I'm using (with two wires) and that I should switch to a 3-wire probe to avoid interference.
Could this be the correct diagnosis ?

Here my prob :https://ibb.co/Nrf5QxK

He also gave me this code for the probe:
FeedCurrent = GetOemDRO(818) 'Get the current settings, OEM DROs (818)=Feedrate DRO
ZCurrent = GetOemDro(802) 'OEM DROs (802)=Z DRO
GageH = GetOEMDRO(1001) 'OEMDRO(1001)=Gage Block Height
ZNew = ZCurrent - 300 'probe down 20 mm

Code "G90F100" 'slow feed rate to 100 MM/MIN
Rem Code "G4 P1" 'Pause 1 second to give time to position probe plate
Code "G31 Z" &ZNew
While IsMoving()
Sleep(10)
Wend
Call SetDro (2,GageH) 'DRO(2)=Z DRO

FinalMove = GageH + 10
Code "G0 Z" &FinalMove
Code "F" &FeedCurrent 'restore starting feed rate dr.lin 2009.10.16

I'll try your code, then their code, then change the sensor if necessary.

Thank you :)