Guia CNC Brasil - Tudo sobre CNC, Router, Laser, Torno e 3D Print
SOFTWARES => Controle => Mach 2/3 => Tópico iniciado por: Antenor Filho em 07 de Fevereiro de 2011, 21:00
-
Olá pessoal, incrementei na minha CNC o Auto Tool Zero e funcionou perfeitamente pelo Mach3, o que eu não achei foi aonde posso configurar a altura do Z, exemplo: a base do "medidor" tem 4.5mm, quando aciono a função Auto Tool Zero o mach manda o eixo Z baixar até achar a base, quando ele acha a base ele sobe 3mm e me dá a posição do Z 0.00. Gostaria de programar para que ele marcasse os 3 que ele subiu mais os 4.5mm da base que então seria Z= + 7.5mm. Isto seria uma macro ???
Abraços à todos. :D
-
e o que fez para implemtar a primeira etapa?
quero colocar o zerador automático na minha..
-
Qual é a mensagem que dá quando vc aciona a função?, not implemented yet?
-
hehe
sem mensagens..
não sei nem por onde começar..
ligar o sensor.. configurar os pino em prob-in.. moleza..
e depois disso.. travei.. heheh
-
Vou tentar te explicar então...
Pega uma porta In e habilita ela, vai em CONFIG, PORTS AND PINS, INPUT SIGNALS, desce até PROBE, aciona o ENABLE, Port 1 e o PIN NUMBER escolhe o que vc irá usar, eu uso o pino 10, tanbém tive q
-
até ai eu já entendi..
quero saber se tem de configurar algo mais.?
-
Desculpe, tive um problema aqui e a mensagem saiu pela metade.
Depois de configurar tive que implementar um script, o que segue abaixo.
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO
If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2" ' two second delay
Code "G31 Z-1.0 F5" 'Z goes down a max of 1.0 at 5IPM
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
Code "G0 Z3.0" 'retract Z to 1.0 inch
Code "(Z axis está zerado)" 'puts this message in the status bar
Code "F" &CurrentFeed 'Returns to prior feed rate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Exit Sub
End If
Fui em Operator, VB Script Editor e executei ele, veja este vídeo e se tiver alguma dúvida me diga
AutoToolZero (http://www.youtube.com/watch?v=8D6-wAbZfwA#)
Abraço!
-
Gostaria da ajuda dos amigos para checar se está tudo certo, executei esta macro e funcionou como eu precisava, o eixo Z desce até achar o contato, achando ele atualiza a DRO para a altura de 7.5mm, que é a altura real da ferramenta até a base ( 7.5mm é a altura do meu testador) e sobe até Z 20. A dúvida ainda é saber qual é a macro que está atribuida ao meu botão AUTO TOOL ZERO pois está macro foi rodada diretamente pelo VB ESCRIPT EDITOR.
Este é o código
CurrentFeed = GetOemDRO(818) 'Salva o feedrate atual para retornar ao final
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO
If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zera o DRO do eixo Z e começa a descer o eixo
Code "G4 P2" ' 2 segundos de espera
Code "G31 Z-5.0 F100" 'Z vai baixar até o limite de -5.0
While IsMoving() 'espera enquanto acontece
Wend
ZProbePos = GetVar(2002) 'pega o exato ponto aonde zera o Z
Code "G0 Z" &ZProbePos 'retorna ao ponto 0, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, 7.5) 'insere na DRO do eixo Z o valor determinado que é 7.5 altura da minha base
Code "G4 P0.25" 'Pausa para atualizar DRO.
Code "G0 Z20" 'retrai Z para +20.0
Code "(Z axis está com a altura de 20mm)" 'retorna esta mensagem para o statusbar
Code "F" &CurrentFeed 'Retorna para o valor anterior do feedrate
Else
Code "(O Sensor já está em contato com o terra, verificar possível curto)" 'retorna esta mensagem para o statusbar
Exit Sub
End If
-
A macro está certa - você só copiou de algum lugar e atribuiu a um botão...
Do jeito que está funciona, mas pode retirar a segunda linha (PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO) porque ela não está tendo funcção nenuma
-
legal, e quanto ao botão AUTO TOOL, no meu Mach já tem uma atribuição desta função, só que não com estes parâmetros, você saberia me dizer como mudar???
Abraço!
-
Desculpe Lolobel - qual seu nome?
Voce pode atribuir a função ao botão da tela do Mach3, exatamente como mostra o filme.
Vai em "Operador" > "Editar Script de Botão", clica sobre o botão "Auto Tool Zero" (na tela principal do Mach3) - cole sua macro nesta janela e salve...
-
Obrigado Gilii !!!
Vou tentar!
Meu nome é Antenor.
Abraço!
-
BOM DIA,
Segui este tópico e tudo roda perfeito até que fresa encontra o terra, então ela para e em vez de fazer o que manda a Macro, o Mach3 me dá a seguinte mensagem; " limit switch triggered ", será que alguem têm uma idéia do que possa estar acontecendo?
-
Veja se o pino que recebe o sinal do probe não está também configurado como final de curso de algum eixo...
Pode ser isso.
-
Olá, desculpe a minha falta de conhecimento,mas quando voce joga o sinal para o pino 15,voce esta jogando o 0.v ou 5.v,pois eu tenho uma placa antiga do hobby cnc que comprei junto com uma placa opto acopladora e ali eu não tenho acesso ao pino 15.
Desde ja obrigado.
-
Desculpe Lolobel - qual seu nome?
Voce pode atribuir a função ao botão da tela do Mach3, exatamente como mostra o filme.
Vai em "Operador" > "Editar Script de Botão", clica sobre o botão "Auto Tool Zero" (na tela principal do Mach3) - cole sua macro nesta janela e salve...
Boa tarde Sr. F.Gilli.
Já testei esse script colocando no botão "Tool Change"do Mach3 e funcionou tudo ok. Saberia me dizer se existe script para "zerar" os eixos x e y também. Penso em fazer isso para sempre encontrar um mesmo ponto inicial, no caso de falta de energia etc Minha CNC não tem "limit swichts". Desde já agradeço a sua atenção!
Genésio
-
Sem Sensores de origem nada feito
-
Sem Sensores de origem nada feito
Olá Gilli,
E esse script abaixo que encontrei poderia zerar os 3 eixos? Fiquei com dúvidas com o entrar com os valores nele.
Grato!
Genésio
' Auto Z and Corner Finding Touch Plate Script version 1.2 - CNC Router Parts 2017
Public TouchPlateHeight, ProbeFeedRate, XProbeDistance, YProbeDistance, ZProbeDistance, TouchPlateWidth, XProbeDirection, YProbeDirection, ZTravelHeight, ZLiftHeight, ToolDiameter As Double
Public ProbeX, ProbeY, PauseProbe, Abort, isImperial, isImperialUOM As Boolean
Sub Main
NoPrompt = False ' False = Use UI to Prompt User for corner finding options
PauseProbe = True ' True = Prompt user to rotate tool before X and Y axis probing
WCSOrigin = 0 ' Default Corner 0=Left/Front 1=Left/Rear 2=Right/Front 3=Right/Rear
ProbeX = False ' By default, do not probe/zero X (change this to True to change the default)
ProbeY = False ' By default, do not probe/zero Y (change this to True to change the default)
ProbeFeedrate = 10 'IPM, Anything from 5-12 IPM will likely work well
TouchPlateHeight = 1 'CRP Touchplate is 1" nominal, can adjust this number to calibrate (usually not required)
TouchPlateWidth = 2.205 'Width of Touchplate is 2.205" (56mm) wide
XProbeDistance = 2 'How long to probe X Axis (inches)
YProbeDistance = 2 'How long to probe Y Axis (inches)
ZProbeDistance = 2 'How long to probe Z Axis (inches)
ZTravelHeight = TouchPlateHeight +.125 'How high to lift tool while probing X and Y (inches)
ZLiftHeight = TouchPlateHeight + .5 'How high to lift tool after script is complete (inches)
ToolDiameter = GetOEMDro(105)
isImperial = GetOEMLED(801)
isImperialUOM = isImperial
Abort = True
If (GetOEMLED(800)) Then
Message ("Error: Emergency Mode is Active ")
Exit Function
End If
If isImperial = False Then
ProbeFeedrate = ProbeFeedrate * 25.4
XProbeDistance = XProbeDistance * 25.4
YProbeDistance = YProbeDistance * 25.4
ZProbeDistance = ZProbeDistance * 25.4
ZTravelHeight = ZTravelHeight * 25.4
ZLiftHeight = ZLiftHeight * 25.4
TouchPlateWidth = TouchPlateWidth * 25.4
TouchPlateHeight = TouchPlateHeight * 25.4
End If
If NoPrompt = False Then
Begin Dialog DlgCheckAxis 15,32,215,90,"Select Axes to Auto Zero",.DlgCheckAxis
OKButton 140,8,40,14
CancelButton 140,30,40,14
GroupBox 10,3,45,50,"",.GroupAxesChk
CheckBox 12,10,30,8,"Z Axis",.ChkBoxZAxis
CheckBox 12,26,30,8,"X Axis",.ChkBoxXAxis
CheckBox 125,50,80,8,"Pause Between Axes",.ChkBoxPauseProbe
CheckBox 12,42,30,8,"Y Axis",.ChkBoxYAxis
GroupBox 62,3,55,68,"",.GroupAxesChk
OptionGroup .grp1
OptionButton 65,10,50,8,"Left/Front",.ComboLeftFront
OptionButton 65,26,50,8,"Left/Rear",.ComboLeftRear
OptionButton 65,42,50,8,"Right/Front",.ComboRightFront
OptionButton 65,58,50,8,"Right/Rear",.ComboRightRear
Text 16,75,100,100,"Tool Diameter: ",.TextToolDiaLabel
TextBox 69,75,30,10,.TextToolDiameter
OptionGroup .grp2
OptionButton 104,75,35,10,"inches",.UnitImperial
OptionButton 139,75,35,10,"mm",.UnitMetric
End Dialog
Dim Dlg1 As DlgCheckAxis
Dlg1.TextToolDiamet er = ""+ToolDiameter
Dlg1.grp1 = WCSOrigin 'default is left/front
Dlg1.grp2 = 0 'default is inches (Imperial)
If isImperial = False Then
Dlg1.grp2 = 1
End If
Dlg1.ChkBoxXAxis = ProbeX
Dlg1.ChkBoxYAxis = ProbeY
Dlg1.ChkBoxPausePro be = PauseProbe
Button = Dialog ( Dlg1 )
ProbeX = Dlg1.ChkBoxXAxis
ProbeY = Dlg1.ChkBoxYAxis
Else
Select Case WCSOrigin
Case 0
XProbeDirection = 1
YProbeDirection = 1
Case 1
XProbeDirection = 1
YProbeDirection = -1
Case 2
XProbeDirection = -1
YProbeDirection = -1
Case 3
XProbeDirection = -1
YProbeDirection = 1
End Select
Abort = false
End If
If ( ProbeX Or ProbeY ) Then
If Not NoPrompt Then
If IsNumeric(Dlg1.TextToolDiamet er) Then
ToolDiameter = CDbl(Dlg1.TextToolDiamet er)
If (isImperial And Dlg1.grp2 = 1) Then
ToolDiameter = ToolDiameter/25.4
End If
If (Not isImperial And Dlg1.grp2 = 0) Then
ToolDiameter = ToolDiameter*25.4
End If
Else
Code "(Invalid Tool Diameter)"
Abort = true
End If
End If
ToolDiameterImperia l = ToolDiameter
If Not isImperial Then
ToolDiameterImperia l = ToolDiameter/25.4
End If
If (Not Abort And ToolDiameterImperia l <= 0) Then
Code "(Tool Diameter is too small)"
Abort = true
End If
If (Not Abort And ToolDiameterImperia l > 2) Then
Code "(Tool Diameter is too large)"
Abort = true
End If
If (Not Abort And Not NoPrompt) Then
SetOEMDro(105,ToolDiameter)
End If
End If
If Not Abort Then
Message ("Auto Tool Sequence Activating...")
AutoZeroMachine
End If
End Sub
Sub AutoZeroMachine()
If GetOEMLED(825) <> 0 Then 'Check to see if the touch plate is already activated
Code "(Touch plate is already activated, check connection and try again)"
Else
FeedCurrent = GetOemDRO(818) 'Get the current settings
XCurrent = GetDro(0)
YCurrent = GetDro(1)
ZCurrent = GetDro(2)
ToolRad = ToolDiameter/2
Code "G4 P1" 'Pause 1sec
Code "F" &ProbeFeedRate
'Always probe z
ZNew = ZCurrent - ZProbeDistance
Code "G31 Z" &ZNew
While IsMoving()
Wend
SetDro(2,TouchPlateHeight)
Code "G0 Z" &ZTravelHeight 'rapid move back off plate enough to travel
If ProbeX Then
If PauseProbe Then
MsgBox "Align Tool Flutes for X-Axis Travel and Press OK"
End If
XNew = XCurrent + (XProbeDistance * XProbeDirection) 'probe vector
Code "G31 X" &XNew
While IsMoving() 'wait for the move to finish
Wend
SetDro(0,(TouchPlateWidth-ToolRad)*XProbeDirection)
If XProbeDirection = 1 Then
Code "G0 X" &(TouchPlateWidth/2)-ToolRad 'Center the tool on touch plate
Else
Code "G0 X" &((TouchPlateWidth/2)-ToolRad)*-1 'Center the tool on touch plate
End If
End If
If ProbeY Then
If PauseProbe Then
MsgBox "Align Tool Flutes for Y-Axis Travel and Press OK"
End If
YNew = YCurrent + (YProbeDistance * YProbeDirection) 'probe vector
Code "G31 Y" &YNew
While IsMoving() 'wait for the move to finish
Wend
SetDro(1,(TouchPlateWidth-ToolRad)*YProbeDirection)
If YProbeDirection = 1 Then
Code "G0 Y" &(TouchPlateWidth/2)-ToolRad 'Center the tool on touch plate
Else
Code "G0 Y" &((TouchPlateWidth/2)-ToolRad)*-1 'Center the tool on touch plate
End If
End If
Code "G0 Z" &ZLiftHeight
Code "F" &FeedCurrent 'restore starting feed rate
Message ("Auto Tool Sequence Complete.")
End If
End Sub
Function DlgCheckAxis( ControlID$, Action%, SuppValue%)
DlgValue "ChkBoxZAxis", 1
DlgEnable "ChkBoxZAxis",0
If DlgValue("ChkBoxPauseProbe") = 1 Then
PauseProbe = True
Else
PauseProbe = False
End If
If DlgValue("ChkBoxYAxis") = 1 Or DlgValue("ChkBoxXAxis") = 1 Then
DlgEnable "ComboLeftFront",1
DlgEnable "ComboLeftRear",1
DlgEnable "ComboRightFront",1
DlgEnable "ComboRightRear",1
DlgEnable "ChkBoxPauseProbe",1
DlgEnable "TextToolDiameter",1
DlgEnable "TextToolDiaLabel",1
DlgEnable "UnitImperial",1
DlgEnable "UnitMetric",1
Else
DlgEnable "ComboLeftFront",0
DlgEnable "ComboLeftRear",0
DlgEnable "ComboRightFront",0
DlgEnable "ComboRightRear",0
DlgEnable "ChkBoxPauseProbe",0
DlgEnable "TextToolDiameter",0
DlgEnable "TextToolDiaLabel",0
DlgEnable "UnitImperial",0
DlgEnable "UnitMetric",0
End If
If DlgValue("ChkBoxXAxis") = 1 Then
ProbeX = True
Else
ProbeX = False
End If
If DlgValue("ChkBoxYAxis") = 1 Then
ProbeY = True
Else
ProbeY = False
End If
If Action = 3 And ControlID$ = "TextToolDiameter" And Not IsNumeric(DlgText("TextToolDiameter")) Then
DlgText "TextToolDiameter",""+ToolDiameter
End If
If Action = 2 Then
If ControlID$ = "UnitMetric" And isImperialUOM Then
ToolDiameter = CDbl(DlgText("TextToolDiameter"))*25.4
DlgText "TextToolDiameter",""+ToolDiameter
isImperialUOM = false
End If
If ControlID$ = "UnitImperial" And Not isImperialUOM Then
ToolDiameter = CDbl(DlgText("TextToolDiameter"))/25.4
DlgText "TextToolDiameter",""+ToolDiameter
isImperialUOM = true
End If
If ControlID$ = "Ok" Then
Abort = False
If DlgValue ("ComboLeftFront") = 1 Then
XProbeDirection = 1
YProbeDirection = 1
ElseIf DlgValue ("ComboLeftRear") = 1 Then
XProbeDirection = 1
YProbeDirection = -1
ElseIf DlgValue ("ComboRightRear") = 1 Then
XProbeDirection = -1
YProbeDirection = -1
ElseIf DlgValue ("ComboRightFront") = 1 Then
XProbeDirection = -1
YProbeDirection = 1
End If
End If
End If
End Function
-
Gilli,
Se puder dê uma olhada nesse vídeo por favor.
Obrigado!
Genésio