Hello Guest it is April 26, 2024, 01:51:46 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - needleworks

Pages: « 1 2 3 4 »
11
General Mach Discussion / Homing?Limits
« on: May 12, 2020, 02:17:22 AM »
Hi guys, looking for a little advice regarding a Mach3 problem.

Today I was machining a part that was very close to being max size for my work envelope, the fact that I had clamped the workpiece slightly in the wrong place, meant that I had reached the limit of travel in the Y direction, and subsequently crashed the machine into my limit switch. Odd thing is that the machine didn't stop, it just kept going susequently ruining the part. After stopping the machine, I checked the switch by manually pressing the switch down, and --- nothing ! I then tried all the rest of the switches and found that none of them were working.

Now before I started this job, I did as I usually do, and hit "ref all home" which resulted in the machine going to the home positions, activating the switches and stopping. To me, this proves that all switches are working as home switches, but none are working as limit switches ?
As a rule, I never tend to hit limit switches so I have no idea how long the machine has been like this. I have never changed any settings in over a year, and everything else is running great.

Also, after this happened I tried the machine running UCCNC, and for some bizarre reason everything works perfect there, machine stops as soon as any limit switch is actvated, and this was set up using the Mach3 xml file. Am I missing a setting in Mach3, or have I unknowingly changed something that I am unaware of ?

Any help greatly appreciated.

12
General Mach Discussion / Re: VB Script
« on: October 11, 2018, 02:08:30 PM »
here we have the X-Center without the debug Windows
Code: [Select]
'simple X-center script
Sub Main()
SetOEMDro(800,0)

    'do the X- probe
    Message ("probe X- ")
    Code "G31 X-100 F150"
    While IsMoving()
        x = GetOEMDRO(800) 'X actpos
        If x <= -100 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe X- canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

Sleep(200)
'get the exact probepos
ProbeXNeg = GetVar(2000)

'clear the probe
Code "G91 X2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"


    'do the X+ probe
    Message ("probe X+ ")
    Code "G31 X200 F150"
    While IsMoving()
        x = GetOEMDRO(800) 'X actpos
        If x >= 200 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe X+ canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

Sleep(200)
'get the exact probepos
ProbeXPos = GetVar(2000)

'clear the probe
Code "G91 X-2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"

'goto the center
middle = ProbeXNeg + ((ProbeXPos - ProbeXNeg)/2)
Code "G90 G01 X" + CStr(middle)
    While IsMoving()
Sleep(10)
    Wend           
SetOEMDro(800,0)

End Sub


and the y-Center

Code: [Select]
'simple Y-center script
Sub Main()
SetOEMDro(801,0)

    'do the Y- probe
    Message ("probe Y- ")
    Code "G31 Y-100 F150"
    While IsMoving()
        y = GetOEMDRO(801) 'Y actpos
        If y <= -100 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe Y- canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

Sleep(200)
'get the exact probepos
ProbeYNeg = GetVar(2001)

'clear the probe
Code "G91 Y2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"


    'do the Y+ probe
    Message ("probe Y+ ")
    Code "G31 Y200 F150"
    While IsMoving()
        y = GetOEMDRO(801) 'Y actpos
        If y >= 200 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe Y+ canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

Sleep(200)
'get the exact probepos
ProbeYPos = GetVar(2001)

'clear the probe
Code "G91 Y-2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"

'goto the center
middle = ProbeYNeg + ((ProbeYPos - ProbeYNeg)/2)
Code "G90 G01 Y" + CStr(middle)
    While IsMoving()
Sleep(10)
    Wend           
SetOEMDro(801,0)

End Sub



hope i did everthing right


 
Thank you again for all your help my friend. It will be later tonight before I can try it but I will let you know how it goes.

Just tried the codes you provided and they are working perfectly. Once again, many thanks for helping me out with this, you are indeed a top man.

13
General Mach Discussion / Re: VB Script
« on: October 11, 2018, 03:09:16 AM »
here we have the X-Center without the debug Windows
Code: [Select]
'simple X-center script
Sub Main()
SetOEMDro(800,0)

    'do the X- probe
    Message ("probe X- ")
    Code "G31 X-100 F150"
    While IsMoving()
        x = GetOEMDRO(800) 'X actpos
        If x <= -100 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe X- canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

Sleep(200)
'get the exact probepos
ProbeXNeg = GetVar(2000)

'clear the probe
Code "G91 X2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"


    'do the X+ probe
    Message ("probe X+ ")
    Code "G31 X200 F150"
    While IsMoving()
        x = GetOEMDRO(800) 'X actpos
        If x >= 200 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe X+ canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

Sleep(200)
'get the exact probepos
ProbeXPos = GetVar(2000)

'clear the probe
Code "G91 X-2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"

'goto the center
middle = ProbeXNeg + ((ProbeXPos - ProbeXNeg)/2)
Code "G90 G01 X" + CStr(middle)
    While IsMoving()
Sleep(10)
    Wend           
SetOEMDro(800,0)

End Sub


and the y-Center

Code: [Select]
'simple Y-center script
Sub Main()
SetOEMDro(801,0)

    'do the Y- probe
    Message ("probe Y- ")
    Code "G31 Y-100 F150"
    While IsMoving()
        y = GetOEMDRO(801) 'Y actpos
        If y <= -100 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe Y- canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

Sleep(200)
'get the exact probepos
ProbeYNeg = GetVar(2001)

'clear the probe
Code "G91 Y2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"


    'do the Y+ probe
    Message ("probe Y+ ")
    Code "G31 Y200 F150"
    While IsMoving()
        y = GetOEMDRO(801) 'Y actpos
        If y >= 200 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe Y+ canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

Sleep(200)
'get the exact probepos
ProbeYPos = GetVar(2001)

'clear the probe
Code "G91 Y-2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"

'goto the center
middle = ProbeYNeg + ((ProbeYPos - ProbeYNeg)/2)
Code "G90 G01 Y" + CStr(middle)
    While IsMoving()
Sleep(10)
    Wend           
SetOEMDro(801,0)

End Sub



hope i did everthing right


 
Thank you again for all your help my friend. It will be later tonight before I can try it but I will let you know how it goes.

14
General Mach Discussion / Re: VB Script
« on: October 10, 2018, 12:04:14 PM »
here is a Version with a small delay after the probes, maybe it is more acurate

Code: [Select]
'simple X-center script
Sub Main()
SetOEMDro(800,0)

    'do the X- probe
    Message ("probe X- ")
    Code "G31 X-100 F150"
    While IsMoving()
        x = GetOEMDRO(800) 'X actpos
        If x <= -100 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe X- canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

Sleep(200)
'get the exact probepos
ProbeXNeg = GetVar(2000)


MsgBox "X Probe - : " + CStr(ProbeXNeg)


'clear the probe
Code "G91 X2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"


    'do the X+ probe
    Message ("probe X+ ")
    Code "G31 X200 F150"
    While IsMoving()
        x = GetOEMDRO(800) 'X actpos
        If x >= 200 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe X+ canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

Sleep(200)
'get the exact probepos
ProbeXPos = GetVar(2000)


MsgBox "X Probe + : " + CStr(ProbeXPos)



'clear the probe
Code "G91 X-2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"

'goto the center
middle = ProbeXNeg + ((ProbeXPos - ProbeXNeg)/2)
Code "G90 G01 X" + CStr(middle)
    While IsMoving()
Sleep(10)
    Wend           
SetOEMDro(800,0)

End Sub



Success !!! That seems to have got it my friend. It is now working perfectly (apart from having to click on the "OK" buttons) I am assuming that the debugging can be removed.

Also, while I am at it, could a Y centre script be done by replacing all instances of  X-  X+   with  Y- Y+ ?

Thank you so much for all your help, much appreciated.

15
General Mach Discussion / Re: VB Script
« on: October 10, 2018, 06:39:45 AM »
the third number is the calculated Center of the two Pobepositions:


Center = ProbeXNeg + ((ProbeXPos - ProbeXNeg) / 2)








Ahh, I see.   Looks like it is giving the centre of the tiny amount that it backs off, after probing X+

16
General Mach Discussion / Re: VB Script
« on: October 10, 2018, 03:45:52 AM »
Once again mate, many thanks for the time you are taking to help me out here :)

Gave this a try this morning and we are certainly getting somewhere. I am probing between two edges that I know to be roughly 40mm apart.

I place the probe (deliberately) off centre in the space and click on "Probe"  The probe starts to move X- and stops when it touches the edge and I now get this message



I click "OK" again and the probe starts to move X+,  after touching the opposite edge, it stops and I get this message



I click "OK" once more and it then backs off a tiny amount and I get this message



Clicking "OK" once more will then return the probe to the centre of the part and the X dro will update to 0.000, so it is in fact now working. I just don't understand the third message that I get with the tiny number !


17
General Mach Discussion / Re: VB Script
« on: October 08, 2018, 08:49:14 AM »
I'm using a genuine UC300 USB controller, and as I said before, every other probing routine works perfectly, in both Mach3 and UCCNC, it's just this "finding the centre in X" move that's got me beat !

18
General Mach Discussion / Re: VB Script
« on: October 08, 2018, 03:35:43 AM »
Code: [Select]
'simple X-center script
Sub Main()
SetOEMDro(800,0)

    'do the X- probe
    Message ("probe X- ")
    Code "G31 X-100 F150"
    While IsMoving()
        x = GetOEMDRO(800) 'X actpos
        If x <= -100 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe X- canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

'get the exact probepos
ProbeXNeg = GetVar(2000)

'clear the probe
Code "G91 X2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"


    'do the X+ probe
    Message ("probe X+ ")
    Code "G31 X200 F150"
    While IsMoving()
        x = GetOEMDRO(800) 'X actpos
        If x >= 200 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe X+ canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

'get the exact probepos
ProbeXPos = GetVar(2000)

'clear the probe
Code "G91 X-2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"

'goto the center
middle = ProbeXNeg + ((ProbeXPos - ProbeXNeg)/2)
Code "G90 G01 Y" + CStr(middle)
    While IsMoving()
Sleep(10)
    Wend           
SetOEMDro(800,0)

End Sub


Still the same I'm afraid ! On one attempt it done the X- no problem and then when it touched off on X+ it backed off 2mm, moved Y+ 2mm and the dro then updated to X 0.000  Y2.000

19
General Mach Discussion / Re: VB Script
« on: October 07, 2018, 03:26:46 PM »
no idea why this warning Comes up, but try this code:

Code: [Select]
'simple X-center script
Sub Main()
SetOEMDro(800,0)

    'do the X- probe
    Message ("probe X- ")
    Code "G31 X-100 F150"
    While IsMoving()
        x = GetOEMDRO(800) 'X actpos
        If x <= -100 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe X- canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

'get the exact probepos
ProbeXNeg = GetVar(2000)

'clear the probe
Code "G91 X2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"


    'do the X+ probe
    Message ("probe X+ ")
    Code "G31 X200 F150"
    While IsMoving()
        x = GetOEMDRO(800) 'X actpos
        If x >= 200 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe X+ canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

'get the exact probepos
ProbeXPos = GetVar(2000)

'clear the probe
Code "G91 X-2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"

'goto the center
middle = ProbeXNeg + ((ProbeXPos - ProbeXNeg)/2)
Code "G90 G01 Y" + CStr(middle)
SetOEMDro(800,0)

End Sub


Ok buddy, this is what I am getting now.

Start probing routine and the first move is X-  After touching off on X- , it starts to go X+ , and after touching off, it now retracts 2mm, and the X dro now updates to read 0.000

I am completely baffled by all this.

20
General Mach Discussion / Re: VB Script
« on: October 07, 2018, 01:01:17 PM »
ok try this, sorry i can't test the code for the Moment.

Code: [Select]
'simple X-center script
Sub Main()
SetOEMDro(800,0)

    'do the X- probe
    Message ("probe X- ")
    Code "G31 X-100 F150"
    While IsMoving()
        x = GetOEMDRO(800) 'X actpos
        If x <= -100 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe X- canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

'get the exact probepos
ProbeXNeg = GetVar(2000)

'clear the probe
Code "G91 X2 F150"
    While IsMoving()
Sleep(10)
    Wend           
Code "G90"


    'do the X+ probe
    Message ("probe X+ ")
    Code "G31 X200 F150"
    While IsMoving()
        x = GetOEMDRO(800) 'X actpos
        If x >= 200 Then
            DoOEMButton(1003) 'Stop too far no probe hit
            MsgBox ("Probe X+ canceled , no probe hit!" )
            Exit Sub
        End If
    Wend           

'get the exact probepos
ProbeXPos = GetVar(2000)

'goto the center
middle = ProbeXNeg + ((ProbeXPos - ProbeXNeg)/2)
Code "G90 G01 Y" + CStr(middle)
SetOEMDro(800,0)

End Sub


We are certainly getting closer my friend, It now probes X- no problem, touches off, then starts to go X+, as soon as it touches the X+ I get the warning again.

Sorry for being a pain in the a** guys.

Pages: « 1 2 3 4 »