Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: shortj042 on May 13, 2025, 09:39:44 PM
-
Hello everyone.
New member here with a bit of an issue.
I recently purchased my first CNC (DMC2 Mini) as a kit and the build itself went relatively OK. Some wiring issues but we got it all working.
At first I couldn't get the probes to work (custom/included code) for the puck and Left/Right/Front/Back probe, so i did a test piece (plastic) with a manual zero. It turned out OK for my first piece.
I played with the probe settings (including varGageThick) and managed to get them all working (late at night).
Today I went to try my first actual part (aluminum) but all the probes are messed up. The Z goes up instead of down and the other 4 all go in the same direction (even though their varGageThick are all the same). So everything appears to have saved OK.
I did a screen change from PA back to Mach3 and back again but that didn't work.
I did a complete shut down, reboot, reload, etc, but still no change.
Any suggestions are greatly appreciated.
John
Here's a sample of the probe code for the left
'*************************************************************************************************************
'******************************* X AXIS (NEGATIVE SIDE) TOUCH SCRIPT FOR MACH3 *****************************
'******FONT********************** FOR BOTH INCH AND MM UNITS ******************************
'*********Courier***************** CHARLIE SARSFIELD REV9 MAY/2018 *******************************
'********************************** WWW.YOUTUBE.COM/SUNNY5RISING ********************************
'*********************************** SUNNY5RISE@GMAIL.COM **********************************
'*************************************************************************************************************
'***************** NOTES: *******************
'***************** TO USE DEFAULT PROBE & GAGE VALUES, SET RELEVANT DRO(S) TO ZERO *******************
'***************** TO USE A GAGE VALUE OF ZERO, ENTER A NEGATIVE VALUE IN THICKNESS DRO *******************
'*************************************************************************************************************
'----- USER VARIABLES FOR DISTANCES, FEED RATES, AND OPTIONS -------------------------------------------------
If GetParam("Units") = 0 Then
'METRIC VALUES
VarMaxDistance = 25.4 'MAX TRAVEL
VarFeedRate = 127 'MM/MIN APPROACH FEEDRATE
VarStandOff = 0 'STANDOFF DISTANCE
VarProbeDia = 4 'DEFAULT PROBE DIAMETER | EDGE FINDER DIA. DRO PRECEDENCE
VarGageThick = 55.05 'DEFAULT GAGE THICKNESS | GAGE THICKNESS DRO PRECEDENCE
'Else
'SAE VALUES
' VarMaxDistance = 1.0 'MAX TRAVEL
' VarFeedRate = 5 'INCH/MIN APPROACH FEEDRATE
' VarStandOff = 0 'STANDOFF DISTANCE
' VarProbeDia = 0.125 'DEFAULT PROBE DIAMETER | EDGE FINDER DIA. DRO PRECEDENCE
' VarGageThick = 0.0036 'DEFAULT GAGE THICKNESS | GAGE THICKNESS DRO PRECEDENCE
End If
'VarDelayInSec = 0 'DEFAULT SECONDS TO DELAY MOTION
'VarBeepOrSpeak = 2 'COUNTDOWN AUDIO: 0=NONE 1=BEEP 2=SPEAK
'VarSecOfAudio = 5 'SECOND AT WHICH AUDIO BEGINS
'VarCompleteAudio = 3 'END SIGNAL: 0=NONE 1=Beep 2=SPEAK 3=WAV_AUDIO_FILE
'VarWavAudioFile = "C:\MACH3\ToolCompleteSND1.wav" 'AUDIO FILE & PATH
'*************************************************************************************************************
'*************************************************************************************************************
'----- GET INITIAL ENVIRONMENT SETTINGS FOR LATER REINSTATEMENT ----------------------------------------------
'VarInitialDistMode = GetOemLED(48) 'DISTANCE MODE G90/G91
VarInitialDistMode = 0
VarInitialLinearMode = GetOemDRO(819) 'LINEAR MODE G00/G01
VarInitialFeedRate = 300 'FEEDRATE
VarInitialInhibit = GetParam("ZInhibitOn") 'Z INHIBIT STATUS OFF/ON
VarInitialXScale = GetParam("XScale") 'X SCALE VALUE
VarInitialFRO = GetOemDRO(821) 'FEEDRATE OVERRIDE PERCENTAGE
Message "" 'CLEAR STATUS LINE TEXT
'----- CHECK DIGITIZE STATE; 0=CLEAR 1=ACTIVE ----------------------------------------------------------------
If GetOemLED (825) <> 0 Then
MachMsg("Digitize Status Not Clear. Check Probe/Connections And Try Again!","*** ERROR! ***",0)
Message "Edge Find CANCELED" 'DISPLAY MESSAGE
End 'END SCRIPT
End If
'----- RETRIEVE PROBE DIAMETER AND GAGE THICKNESS ------------------------------------------------------------
If VarProbeDia = 0 And GetOEMDRO(1000) = 0 Then
MachMsg("Coffee First, Then Provide Probe Diameter And Try Again.","*** ERROR! ***",0)
Message "Edge Find CANCELED" 'DISPLAY MESSAGE
Sleep 2000 : Message ""
End 'END SCRIPT
Else
If GetOEMDRO(1000) <> 0 Then VarProbeDia = Abs(GetOEMDRO(1000)) 'CHECK AND GET FINDER DIA DRO VALUE IF USED
End If
If GetOEMDRO(1001) <> 0 Then 'CHECK FOR GAGE THICKNESS VALUE
Select Case InStr(1,GetOEMDRO(1001),"-") 'CHECK IF NEGATIVE IS USED
Case 0 'NEG NOT PRESENT
VarGageThick = Abs(GetOEMDRO(1001)) 'SET GAGE THICKNESS TO DRO VALUE
Case 1 'NEG IS PRESENT
VarGageThick = VarGageThick 'SET GAGE THICKNESS TO ZERO
End Select
End If
Select Case GetParam("Units") 'SET UNITS FOR STATUS LINE DISPLAY
Case 0 'MM
VarMsgUnits = "mm"
Case 1 'INCH
VarMsgUnits = "in"
End Select
'FORMAT STATUS LINE TEXT
VarStatusMsg = "Probe: " &VarProbeDia &VarMsgUnits &" Gage: " &VarGageThick &VarMsgUnits
'----- ACTIVATE TIME DELAY IF USED ---------------------------------------------------------------------------
VarDelayInSec = Abs(VarDelayInSec)
If VarDelayInSec <> 0 Then
Do Until VarDelayInSec = 0 'LOOP UNTIL SECONDS = ZERO
Message VarDelayInSec 'DISPLAY SECONDS VALUE IN STATUS LINE
If VarDelayInSec < VarSecOfAudio + 1 Then
Select Case VarBeepOrSpeak
Case 1 'OPTION BEEP
Beep
Case 2 'OPTION SPEAK
Speak(VarDelayInSec)
End Select
End If
Sleep 1000 'PAUSE 1 SEC.
VarDelayInSec = VarDelayInSec - 1 'REDUCE SECONDS BY 1 AFTER EACH LOOP
Loop
End If
'----- CANCEL SCALE, FEEDRATE OVERRIDE, Z-INHIBIT ------------------------------------------------------------
SetParam("XScale",1.0) 'SET X SCALE TO 1.0
DoOemButton(1014) 'CANCEL FEED OVERRIDE
SetParam("ZInhibitOn",0) 'TURN Z INHIBIT OFF
'----- MOVE PROBE TOWARD CONTACT -----------------------------------------------------------------------------
SetOemDRO(800,0) 'ZERO X AXIS DRO
Sleep 200 'DELAY TO ALLOW DRO TO CHANGE
Message VarStatusMsg &" X Zero Running..."
Code "G90 G31 X" &VarMaxDistance &"F" &VarFeedRate 'MOVE IN X POS DIRECTION
While IsMoving() 'WAIT UNTIL MOVE IS COMPLETE BEFORE PROCEEDING
Wend
'----- GET CONTACT POSITION AND TEST FOR MAX TRAVEL ------ MOVE TO STANDOFF ------ UPDATE X AXIS DRO ---------
'If GetVar(2000) >= (VarMaxDistance - .001) Then
If 1=2 Then
MachMsg("Maximum Travel Reached. Reposition X Axis Closer To Part And Try Again!","*** OOPS! ***",0)
Message ""
RETURNSTATE 'CALL REINSTATE SUBROUTINE
End 'END SCRIPT
Else
Beep
' Code "G90 G0 X" &GetVar(2000) 'MOVE TO CONTACT POINT DUE TO OVERRUN
While IsMoving()
Wend
SetOemDRO(800,0) 'ZERO X AXIS DRO
Sleep 200
' Code "G90 G1 X-" &VarStandOff &"F" &VarFeedRate*2 'MOVE TO STANDOFF DISTANCE
Code "G90 G1 X-" &2 &"F" &600 'This is backing off of the part after contact
While IsMoving ()
Wend
SetOemDRO(800, "-" &VarStandOff + VarGageThick + (VarProbeDia/2)) 'SET X DRO
Sleep 200
Select Case VarCompleteAudio
Case 1 'OPTION BEEP
Beep
Case 2 'OPTION SPEAK
Speak("Tool Zero Complete.")
Case 3 'OPTION WAV_AUDIO_FILE
PlayWave(VarWavAudioFile)
End Select
Message VarStatusMsg &" X Tool Zero Complete!"
End If
RETURNSTATE 'CALL REINSTATE SUBROUTINE
End 'SCRIPT COMPLETE
'******************************************* SUBROUTINE BELOW ************************************************
'----- SUBROUTINE TO RETURN INITIAL SETTINGS -----------------------------------------------------------------
Sub RETURNSTATE
'REINSTATE INITIAL FEEDRATE
Code "F" &VarInitialFeedRate
'REINSTATE DISTANCE MODE 0=G91 -1=G90
If VarInitialDistMode = 0 Then Code "G91" Else Code "G90"
'REINSTATE LINEAR MODE 0=G00 1=G01
If VarInitialLinearMode = 0 Then Code "G00" Else Code "G01"
'REINSTATE Z INHIBIT STATUS 0=OFF 1=ON
If VarInitialInhibit = 1 Then SetParam("ZInhibitOn",1)
'SET X SCALE TO INITIAL VALUE
If VarInitialXScale <> 1.0 Then SetParam("XScale",VarInitialXScale)
'SET FEEDRATE OVERRIDE TO INITIAL VALUE
If VarInitialFRO <> 100 Then SetOemDRO(821,VarInitialFRO)
End Sub
'*************************************************************************************************************
-
i would do some simple test's by using MDI input line:
first make sure you are on absolute mode:
G90
then try to do a probe with Z:
G31 Z-10 F20
this will do a simple Z-probe 10mm down with speed 20mm/min
i asume you are in metric unit's.
then you can see what happens without using scripts were you are not sure what is going on.
-
Thanks for the suggestion TPS.
Here's what happened:
G31 Z-10 F20 Y axis moved in - direction. Right speed but didn't stop at the desired distance (kept going)
G31 X10 F50 Y axis moved in - direction. Right speed but didn't stop at the desired distance (kept going)
G31 Y10 F50 Y axis moved in - direction. Right speed but didn't stop at the desired distance (kept going)
Is it possible I have a bad board?
Thanks again
-
Sometimes that behaviour results because the machine isn't homed or referenced correctly. Try restarting/rehoming
-
witch board/motion controller are you using?
-
The board is a Mach3 board coupled with a custom manufacturer breakout board.
Tonight we managed to get it all working properly and homed 4 times successfully, but then it all went pot again, reverting back to doing the same as before. No idea what's going on. Makes no sense.
It's like the machine doesn't remember the info from the files.
question, Does the machine have to read the files each time you probe, or are the held in some memory on the board?
Thanks again
-
What do you mean by Mach 3 board? Could you provide a photo?
-
If the "board" is a motion controller then that should be where probing is handled. Probing requires motion to stop as quickly as possible once the probe triggers, and thye system can't afford the round trip time for the probe signal to make it through Mach 3 and into the motion controller to make it stop. That's why we are asking what the specific board is. How does the Mach 3 PC connect to it?
For example, I use the UC100 motion controller which has a USB interface to the PC, probing works just fine. Previously I used Mach 3 on an old PC with parallel port, where the "motion controller" is an integral part of Mach 3 - that worked fine as well. As I mentioned above, occasionally I've had probe issues a bit similar to yours which have cleared when I re-homed the controller.
-
The board is a Mach3 as per attached, connected via USB.
I spoke with the supplier this morning and we removed 2 files from the Mach3 directory that they suspected might be causing conflicts with other files:
1. Mach3mill.xml removed, DMCmill.xml being used.
2. 1045.set removed, PA Interface being used.
This initially worked and the probing was all fine (6 times). I decided to confirm everything with a complete power down and reboot, which undid whatever was working.
After trying a few more probes, it started working again. So, I tried a simple PC reboot and all was OK.
After setting a working coordinate, I homed the machine and tried GO TO XYZ 0 and it worked. I also tried from numerous random positions and all was OK.
I watched the DRO while probing to confirm the numbers coincided with the script files and they do.
Now for todays odd part. After everything seemed OK, I tried one last time and low and behold it crapped out. When I tried GO TO XYZ 0, it moved the spindle so that the Zero point was somewhere inbetween the spindle center and the probe center. This is where it stands.
I have asked the supplier to provide a new control board so as to rule it out ( a big pain, but if it fixes the issue, it'll be work it).
Could this be a simple grounding issue? We had to add an extra grounding wire between the controller board and the bed, just to get the probes to function and they do appear to be functioning properly. It's the probing itself that is the issue.
Thanks again for the support (this might show up as a second reply, but hopefully not).
Cheers
-
I recently found another funny bug. I zeroed my tool, as usual. My zeroing procedure involves fast travel to the plate, then slight back off, then slow travel to the same plate. Usually it works like a charm, but this time, when it had to probe second time, it went not down, but sideways! So it was reflected in the log:
Sat - 11:47:32 ---Probe to (188.654983,-114.833932,-25.248900,0.000000)
Sat - 11:47:39 ---Probe hit (188.656922,-114.828672,13.927350,0.000000)
Sat - 11:47:40 ---Probe to (-114.828672,12.927350,0.000000,0.000000) ' should be like Probe to (188.654983,-114.833932,12.927350,0.000000)
Sat - 11:48:00 ---Error on line: 568 - Internal error <CodeAndWait> ' here i stopped it manually
Sat - 11:48:00 ---Error on line: 433 - Internal error <MessageAndSleep>
My code doing this looks literally like this:
CodeAndWait "G90 G31 Z" & MinZ & " F" & VarFastFeedRate ' rough measurement
Dim TouchSuccessful As Integer
TouchSuccessful = GetOEMLED(TOUCH_PROBE_LED) ' OEM LED Digitize Input 825
If Not TouchSuccessful Then Goto ErrorHandler ' no, it is not going there in this case
ZProbingResult = GetVar(Z_PROBE_RESULT_VAR)
CodeAndWait "G90 G0 Z" & ZProbingResult + TOUCH_BACKOFF ' move slightly higher than measured contact point
CodeAndWait "G90 G31 Z" &ZProbingResult - TOUCH_BACKOFF & " F" & VarSlowFeedRate ' fine measurement
' ...
End
Sub CodeAndWait(c)
If IsEStop() Then
' mach3 does not stop macro execution if estop is on!! so we must do it ourselves
StopAndEnd "Emergency stop occured during macro execution!", "ERROR!!1"
End If
Code c
' Wait for operation to complete
While IsMoving()
Sleep(100)
Wend
Sleep 200
End Sub
So no dirty hacks, no system variable changes, even no x or y is ever given to g31! So mach3 itself had shuffled destination coordinates.
I think 90% it is mach3 bug (and 10% chance it is the controller ("eth-mci") driver bug).
-
I have never experienced a bug like this with Mach 3 either through the parallel port or UC100 motion controller. Nor have I ever seen one reported on here. I think therefore it must either be in the motion controller or possibly a wiring problem between that and the drives. Poor or intermittent contacts, and / or earthing issues, can give rise to odd phenomena.
-
> in the motion controller or possibly a wiring problem between that and the drives
In this case these wires or controller should alter the mach3's memory content directly. Otherwise the machine can behave in any way, but the numbers in the mach3's log should be correct.
-
Well there is a fairly intimate 2-way connection between the motion controller and Mach 3. This must be so as for example when probing the MC has to tell Mach when and where it has stopped. So I suspect that there is a bug in the MC software
-
Are you using a licence file that was supplied with the breakout board?
-
This must be so as for example when probing the MC has to tell Mach when and where it has stopped.
There is no need to get access to all mach3 memory to do so. If it is, it is a major design flaw in mach3 itself regardless how often it leads to bugs. And even if it is, in the log we see that mach3 got perfectly correct touch coordinates and only then decides to go wrong way. So it must be very strange bug if it is a driver/controller/wiring bug.
Are you using a licence file that was supplied with the breakout board?
I am using mach3 as it came with completely new machine, it says it is licensed to machine manufacturer. I do not know if it is genuine license or not.
-
Well that seems to exhaust all the possibilities then. Can't help any further.
-
I actially posted it as a fun story, i did not hoped anyone will help me with this, considering mach3 developers abandoned it 15 years ago. Thanks for trying!
-
Well that was a waste of cycles all round then.
-
Thanks everyone for the assistance. I have it sorted out. Turns out that the motion controller had issues. I now have a new one installed.
Cheers