Czujnik wysokości pomocy

Dyskusje dotyczące najpopularniejszego programu sterującego maszynami CNC
Awatar użytkownika

Autor tematu
mumin
Specjalista poziom 2 (min. 300)
Specjalista poziom 2 (min. 300)
Posty w temacie: 3
Posty: 577
Rejestracja: 01 gru 2004, 14:44
Lokalizacja: śląsk

Czujnik wysokości pomocy

#1

Post napisał: mumin » 04 cze 2012, 10:46

Piszę bo już mi ręce opadły, zainstalowałem Mach Blue Probing by Big-Tex skonfigurowałem podłączyłem płytkę i wszystko zadziałało poprawnie ale niestety moja radość nie trwała długo.
Nie wiem co po przestawiałem ale teraz działanie jest tragiczne wrzeciono zjeżdża do płytki odczytuje pozycję podjeżdza ponownie wolniej (czyli tak jak ma być) a następnie jedzie w dół !!! podpowiedzcie co poustawiać bo załamanie mnie ogarnia.
Załączam makro
Załączniki
HiddenScript.zip
(1.79 KiB) Pobrany 282 razy



Tagi:

Awatar użytkownika

Autor tematu
mumin
Specjalista poziom 2 (min. 300)
Specjalista poziom 2 (min. 300)
Posty w temacie: 3
Posty: 577
Rejestracja: 01 gru 2004, 14:44
Lokalizacja: śląsk

#2

Post napisał: mumin » 15 lis 2013, 07:08

Temat stary ale po ostatnich przeróbkach rozwiązany przezemnie problem powrócił i przypomniało mi się że nie podzieliłem się "rozwiązaniem"
A rozwiązaniem jest obrócenie podłączenia jednego z uzwojeń silnika i następnie zmiana kierunku w opcjach macha. Działa ale dlaczego ? może przy okazji się dowiem ?


sp9kn
Sympatyk forum poziom 1 (min. 40)
Sympatyk forum poziom 1 (min. 40)
Posty w temacie: 2
Posty: 44
Rejestracja: 31 gru 2012, 08:01
Lokalizacja: Zawiercie

#3

Post napisał: sp9kn » 19 lis 2013, 06:16

A możesz makro wkleić w postacie kodu na stronie?
Mnie się strasznie rozjeżdża a z chęcią zobaczę co w nim nie tak?
SP9KN

Awatar użytkownika

Autor tematu
mumin
Specjalista poziom 2 (min. 300)
Specjalista poziom 2 (min. 300)
Posty w temacie: 3
Posty: 577
Rejestracja: 01 gru 2004, 14:44
Lokalizacja: śląsk

#4

Post napisał: mumin » 19 lis 2013, 06:43

Kod: Zaznacz cały

Sub Main() 'made it a sub, so you can return on "show stopper" errors
'Option Explicit 'Written by Big-Tex Dec 26 2010
'Mod pb 11dec10

Dim ZNew, Zplate, Zrestposition, ZMaterialmachcoord, ZPlatejobcoord, Zplatetomaterial
Dim xjobcoord, yjobcoord, xmachcoord, ymachcoord, zmachcoord
Dim xprobeloc, yprobeloc, xtoprobe, ytoprobe, PlateOffset
Dim CurrentFeed
Dim CurrentAbsInc

xjobcoord = GetDRO(0) 'get current job coordinate for X
yjobcoord = GetDRO(1) 'get current job coordinate for Y
xmachcoord = GetOemDRO(83) 'get current machine coordinate for X
ymachcoord = GetOemDRO(84) 'get current machine coordinate for Y
zmachcoord = GetOemDRO(85) 'get current machine coordinate for Z
xprobeloc = GetUserDRO(1100) 'get X machine coordinate location of the touch plate
yprobeloc = GetUserDRO(1101) 'get Y machine coordinate location of the touch plate
xtoprobe = (xprobeloc - xmachcoord + xjobcoord) 'calculate the X move from the current location to the touch plate
ytoprobe = (yprobeloc - ymachcoord + yjobcoord) 'calculate the Y move from the current location to the touch plate
PlateOffset = GetUserDRO(1151) 'get plate offset DRO
CurrentFeed = GetOemDRO(818) 'get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state

'//////// the block below will set all your reusable vars depending on Inch or mm.
'//////// this sets the vars so you only need ONE large block of probing code.

If GetOEMLED(801) Then 'ON = English Measure INCH
FirstProbeDist = 6.0 'first probe travel
FirstRetractDist = 0.1 'first probe retract travel
SecProbeDist = 0.25 'second probe travel
FirstProbeFeed = 10 'First Probe Feed Speed
SecondProbeFeed = 2 'Second Probe Feed Speed
'CalcRetract = 2.6315 'calc retract
Zretract = -0.5 'Z reftact
Else 'OFF = Metric Measure MM
FirstProbeDist = 150.0 'first probe travel
FirstRetractDist = 3.0 'first probe retract travel
SecProbeDist = 6.0 'second probe travel
FirstProbeFeed = 300 'First Probe Feed Speed
SecondProbeFeed = 50 'Second Probe Feed Speed
'CalcRetract = 50 'calc retract
Zretract = -12 'Z retract
End If

'//////// Error Condition checking code

If GetOemLED(16)<>0 Then 'Checks for machine coordinates
Code "(Please change to working coordinates)"
Exit Sub 'ERROR! exit the macro
End If

If GetOemLED(825)<>0 Then
Code "(Z-Plate Grounded Check connection and try again)"
Exit Sub 'ERROR! exit the macro
End If

'//////// Start Probing Code, Probe In -Z direction.MOVABLE PROBE PLATE
'//////// The vars will be Inch or Metric from above if/else statment

sleep(1000) 'pause 1 seconds to give time to position probe plate
Code "F" & FirstProbeFeed 'slow down feedrate to 10 ipm
ZNew = ( GetDro(2) - FirstProbeDist ) 'probe move to current z - 6 inches
Code "G90 G31Z" & ZNew
While IsMoving() 'wait for probe move to finish
Wend
ZNew = GetVar(2002) 'read the touch point
Code "G0 Z" & ( ZNew + FirstRetractDist ) 'move back to hit point incase there was overshoot +.1
While IsMoving ()
Wend
Code "F" & SecondProbeFeed 'slow down feedrate to 2 ipm
ZNew = ( GetDro(2) - SecProbeDist ) 'probe move to current z - .25 inches
Code "G90 G31Z" & ZNew
While IsMoving() 'wait for probe move to finish
Wend
ZNew = GetVar(2002) 'read the touch point
Code "G0 Z" & ZNew 'move back to hit point incase there was overshoot
While IsMoving ()
Wend
If PlateOffset <> 0 Then
Call SetDro (2, PlateOffset) 'set the Z axis DRO to plate thickness
sleep(250) 'pause for Dro to update.
'ZNew = PlateOffset + CalcRetract 'calc retract
'Code "G0 Z" & ZNew 'put the Z retract height you want here
Code "G53 G0 Z" & Zretract
While IsMoving ()
Wend
End If

'//////// Start Probing Code, Probe In -Z direction.FIXED PROBE PLATE
'//////// The vars will be Inch or Metric from above if/else statment

'Probe In the z direction
sleep(250) 'pause for Dro to update.
Zrestposition = GetDro(2) 'get the job cooridnate of the Z axis after setting Z
ZMaterialmachcoord = ( GetOemDRO(85) - ZNew ) 'get current machine coordinate for Z & calc the top of the material for use later
sleep(1000) 'pause for Dro to update
Code "G0X" & xtoprobe & " Y" & Ytoprobe 'rapid to the location of the plate
Code "F" & FirstProbeFeed 'slow down feedrate to 10 ipm
ZPlate = ( GetDro(2) - FirstProbeDist ) 'probe move to current z - 6 inches
Code "G90 G31Z" & ZPlate
While IsMoving() 'wait for probe move to finish
Wend
ZPlate = GetVar(2002) 'read the touch point
Code "G0 Z" & ( ZPlate + FirstRetractDist ) 'move back to hit point incase there was overshoot+.1
While IsMoving ()
Wend
Code "F" & SecondProbeFeed 'slow down feedrate to 2 ipm
ZPlate = ( GetDro(2) - SecProbeDist ) 'probe move to current z - .25 inches
Code "G90 G31Z" & ZPlate
While IsMoving() 'wait for probe move to finish
Wend
ZPlate = GetVar(2002) 'read the touch point
Code "G1 Z" & ZPlate 'move back to hit point incase there was overshoot
While IsMoving ()
Wend
Zplatetomaterial = GetDRO(2) 'record the current coordinate of the bottom of the tool and plate
Call SetUserDRO(1102,Zplatetomaterial) 'this sets a user DRO to the value of the top of material to top of plate
sleep(250) 'pause for Dro to update.
'ZNew = ( PlateOffset + CalcRetract ) 'calc retract
'Code "G0 Z" & ZNew 'put the Z retract height you want here
Code "G53 G0 Z" & Zretract
While IsMoving () 'wait for probe move to finish retracting
Wend
Code "G0X" & xjobcoord & " Y" & yjobcoord 'returns to the previus X Y job location
While IsMoving()
Wend
Code "F" & CurrentFeed 'returns to prior feed rate

'//////// End Probing Code,

If GetOEMLED(801) Then 'ON = English Measure INCH
Code "(Material Offset is Now Calculated in English Units)" 'puts this message in the status bar
Else 'OFF = Metric Measure MM
Code "(Material Offset is Now Calculated in Metric Units)" 'puts this message in the status bar
End If

If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
Code "G91"
End If

End Sub  


[ Dodano: 2013-11-19, 07:42 ]
Wydaje mi się że program jest ok ale...
Po rozwiązaniu problemu opuszczania i wjazdu w materiał, pozostaje jeszcze jeden problem "mniej szkodliwy" Teraz praca makro jest następująca oś opuszcza się do płytki pomiarowej szybko, po uzyskaniu kontaktu podnosi się i następnie opuszcza się powoli, po uzyskaniu kontaktu jedzie do góry aż do limit switch'a który wyłacza przejazd i wywala błąd limitu oraz komunikat że wysokość jest ustawiona. Tak się dzieje jeśli limity są zablokowane jeśli nie to jedzie aż do urwania tego co jest najsłabsze.


sp9kn
Sympatyk forum poziom 1 (min. 40)
Sympatyk forum poziom 1 (min. 40)
Posty w temacie: 2
Posty: 44
Rejestracja: 31 gru 2012, 08:01
Lokalizacja: Zawiercie

#5

Post napisał: sp9kn » 23 lis 2013, 18:52

Program jest ok o ile używasz pewnych rzeczy, np. offsetów.
Jeśli nie to trzeba zmodyfikować program usuwając G53.
Sprawdzone na moje maszynie i jest OK.
SP9KN

ODPOWIEDZ Poprzedni tematNastępny temat

Wróć do „Mach 2 / 3 / 4 (ArtSoft software)”