Gestion palpeur outil Mach3

  • Auteur de la discussion Otatiaro
  • Date de début
O

Otatiaro

Compagnon
Salut,

Je voulais juste savoir si dans Mach3, on peut gérer a la fois une origine machine et un palpeur d'outil en Z.

Pour le moment, en fait, je met systématiquement la longeur d'outil a 0, et je reprend l'OM en Z a chaque changement d'outil ... ca marche, mais ca a un inconvénient.

En effet, suivant la longeur de l'outil, ma limite haute en Z change (si l'outil est court, j'ai plus de marge en Z que si l'outil est long et mon axe Z déjà pas mal remonté avant de prendre l'OM).

Idéalement, ce que je voudrais, c'est prendre l'OM en Z, sans outil, pour avoir une vraie référence fixe, et ensuite, (si possible avec le même capteur), prendre une référence qui me placerait automatiquement la longueur d'outil bien comme il faut.

Je sais qu'en temps normal, on prend la longuer d'outil dans son support, que l'on rentre dans le logiciel, mais comme la Kress n'a qu'un systeme de pince, avec le même outil, la longeur sortie de l'outil varie a chaque fois ... Là je voudrais que ce soit automatisé : si je dois prendre une référence, calculer la longeur d'outil, la rentrer dans le logiciel a un autre endroit, etc, avant de pouvoir relancer le cycle, ca ne m'interesse que moyennement.

Comme ca en G53, sans correction d'outil, je sais jusqu'ou je peux aller en Z, quel que soit l'outil.

C'est faisable, ou c'est chiant ?

++
 
P

Pastaga

Apprenti
:roll: Je ne connais pas Mach

Mais, si tu prends ton OP par apport au nez de broche :roll:

Example:

Tu prends on OP en Z avec une cale de 100mm et tu tape Z100 en G54

Ensuite quand tu fais tes Lg outil par apport à la même OP, tu te retrouve avec des Lg positive et fixe :roll:

Donc si tu change de pièce, tu refais ton OP avec ta cale et tu n'as pas besoin de refaire tes lg.

Pour ce qui est des dégagement, tu les programme en G52 (par aport à l'OM cette fois)

G54 Origine Pièce
G52 Origine machine

Code à vérifier si tu es en ISO
 
O

Otatiaro

Compagnon
Salut,

J'ai pas bien tout compris :wink:

Mon probleme est pour un changement d'outil, pas pour un changement de pièce (brut).

Le truc que je voudrais, c'est de calculer automatiquement la longeur outil en prenant une origine machine (nez de broche) et une origine "avec outil" (qu'il fasse la diff entre les deux hauteurs pour alimenter directement la longeur d'outil).

Comme ca je peux activer ou désactiver la compensation de longeur d'outil (chose que je ne peux pas aujourd'hui puisque ma "longeur outil" est fixée a 0mm).

Je sais pas si je suis très clair :wink:

++
 
O

ordinerf

Compagnon
Mach3 est riche en possibilité, il peut prendre en charge les port LPT et COM ce qui fait quand même minimum 3 port donc un pour la machine et les autre répartis pour d'autre besoin comme le palpeur, une télécommande, etc...
 
O

Otatiaro

Compagnon
ordinerf a dit:
Mach3 est riche en possibilité, il peut prendre en charge les port LPT et COM ce qui fait quand même minimum 3 port donc un pour la machine et les autre répartis pour d'autre besoin comme le palpeur, une télécommande, etc...

Salut,

Je dois mal m'exprimer, le probleme n'est pas là (connectique) :wink:

Le but est de palper les outils avec le même inter que celui qui sert a prendre l'origine machine.

La question de fond est : est-ce qu'on peut renseigner automatiquement la longeur de l'outil avec deux palpages successifs (un sans outil, un avec outils) dans Mach3, au niveau purement logiciel ... ou est-ce qu'il faut faire les deux palpages, aller dans les fixture, et mettre la bonne longeur d'outil a la main ?

++
 
O

ordinerf

Compagnon
palper un outil sincèrement je n'en sais rien, j'ai étudié le problême un jour pour un changement d'outil automatique avec prise d'outils de longueur différente et malheureusement je n'ai pas pu continuer mon étude, d'autant qu'il incluait un système de prise d'outil adapté à tout outils du commerce foret compris.
mais je ne lache pas l'affaire d'autant que récemment j'ai eu une super idée :)
le palpage à mon avis est limité au dimensions de la pièce et au point 0, je n'affirme pas ce que je viens de dire, c'est juste ce que je sais de Mach3 :wink:
 
F

fred250

Compagnon
Oui visiblement c'est possible mais il faut faire une macro
il y a un sujet ici (prépare de l'aspirine)
 
L

la_coterie

Ouvrier
Oui visiblement c'est possible mais il faut faire une macro
il y a un sujet ici (prépare de l'aspirine)
l'aspirine car c'est franglais :mrgreen:

vraiment ce n'est pas dur a faire
 
O

Otatiaro

Compagnon
Hello,

I write this post in English because la_coterie seems to be the one who can help me :wink:

I need more informations as I will try to get things working this Week-end (and because I'm lazy at work :wink: ).

What I'd like is :

- I launch Mach3
- I turn my CNC on
- I Manually reference all axis X, Y, Z, in machine coordinates, using my homing switches (in fact, I will use my tool sensor as Z homing switch, as it's fixed on the mill table, and sense without any tool in the spindle)
- I put the part to mill in the vice, then set X and Y offset zero if changed(that doesn't change machine coordinates zero, that's it ?), I doesn't core of Z axis
- I put the first tool in the spindle, that's where it become more complex :

a - the spinde goes to a preset position where it is easy to change the tool (position in G53, I can go full up in Z because I got my Z "real" homing without tool)
b - A message appear on the screen, asking me to put the tool number X in the spindle then click ok
c - I manually change the tool in the spindle, then click ok
d - It goes X and Y above the tool sensor in G0 and G53
e - It goes Z down at, say, 50% of maximum Z velocity, until tool sensor clicks
f - It goes back something like 5mm
g - Then if sense the tool once again, at a slower speed (maybe 5 or 10% of max Z axis velocity)
h - This set the OFFSET (still not changing machine Z coordinates), at a predefined value (I got to measure Z distance between my tool sensor or the top of the vice, that's it ?), making Z OFFSET zero at the top of the vice AT THE END OF THE TOOL.
i - The Z axis goes up at max (Z = 0 in machine coordinates, in fact)
j - Maybe got to replace the spindle at the exact some location as before tool change (considering tool length change has been handled in offset Z zero change) ?

- Milling can start
- At each tool change, the same actions from a to j repeats
- When milling is finished, the spindle goes to a G53 preset location (for an easy access to the vace and milled part)


That's what I would be proud of :wink:

Now, what I need to do (correct me if I'm wrong) :

- Configure my tool sensor to be both probe input and Z homing input
- Set Z homing position (in homing/limits screen) so that when it touch the homing sensor, Z = 0 at full upper spindle position
- Calculate Z distance between the tool sensor and top of vice
- Produce the code in VB to get the actions I want for M30 and tool change macros
- Get the code in the right location
- Setup Mach to call the macro at tool change (including first tool)


I need you to :

- Help me write the VB scripts
- Tell me where to put the scripts so that they are called right

M30 Script a dit:
' Declare some import functions
Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)

' Defines clear positions for stop
ClearPositionX = XXXX 'Set the clear position in X.
ClearPositionY = XXXX 'Set the clear position in Y.
ClearPositionZ = XXXX 'Set the clear position in Z.

' And here we go !
Code "M5 M9" 'Turn of spindle and coolant

Code "G90 G53 G0 Z" &ToolChangePositionZ 'Goes max up in Z
While IsMoving()
Sleep 100
Wend

Code "G90 G53 G0 X" &ToolChangePositionX " Y"&ToolChangePositionY 'Goes at clear location in X and Y
While IsMoving()
Sleep 100
Wend

' Finished !

I know I don't need to repeat G90 G53 G0, but last time, playing with these G-Code, I had problems with Mach getting back to G54 without telling me ...

Tool Change Script a dit:
' Declare some import functions
Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)

' Set some variables (depending on mill configuration)
ToolChangePositionX = XXXX 'Set the tool change position in X (in G53).
ToolChangePositionY = XXXX 'Set the tool change position in Y (in G53).
ToolChangePositionZ = XXXX 'Set the tool change position in Z (in G53).
ToolSensorPositionX = XXXX 'Set the tool sensor position in X (in G53).
ToolSensorPositionY = XXXX 'Set the tool sensor position in Y (in G53).
ToolSensorMargin = XXXX 'Set the back in Z between fast and slow probing.
ZGapBetweenSensorAndTopVice = XXXX 'Set the Z distance between tool sensor and the top of the vice

'Get current values for data that will be changed

If GetOEMLED(48) = 0 'Get if current mode is absolute or incremental
CurrentIncrOrAbs = "G91"
Else
CurrentIncrOrAbs = "G90"
End If

CurrentOffset = ???? 'Get current offset
CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
ProbeFeed = GetUserDRO(1152) 'You could put a probing feedrate here instead.
SlowProbeFeed =ProbeFeed / 10
PreviousX = GetOEMDRO(800) 'X position before tool change
PreviousY = GetOEMDRO(801) 'Y position before tool change
PreviousZ = GetOEMDRO(802) 'Z position before tool change


' And here we go !
If GetOemLed (825)=0 Then

Code "G90 G53 G0 Z" &ToolChangePositionZ
While IsMoving()
Sleep 100
Wend

Code "G90 G53 G0 X" &ToolChangePositionX " Y" &ToolChangePositionY
While IsMoving()
Sleep 100
Wend

Code "M1" 'M1 will stop program until cycle start is pressed, but i'd prefer a messagebox to be shown

'From now on, the new tool is in the spindle

Code "G90 G53 X" &ToolSensorPositionX " Y" &ToolSensorPositionY 'Goes above the sensor location
While IsMoving()
Sleep 100
Wend

Code "G31 Z-200 F" &ProbeFeed 'Probe with fast probing speed
While IsMoving()
Wend

Code "G91 G53 G0 Z" &ToolSensorMargin 'Goes a little bit above the sensor for the slow speed probing
While IsMoving()
Sleep 100
Wend

Code "G31 G53 G91 Z-200 F" &SlowProbeFeed 'Probe with slow probing speed
While IsMoving()
Wend

'Here we are exactly at tool tip on sensor Z

Code "G" &CurrentOffset 'Back to part offset
Call SetDro (2, ZGapBetweenSensorAndTopVice ) 'Set offset Z=0 at top of vice
Code "G4 P0.5" 'Pause for Dro to update.

Code "G53 G90 G0 Z" &ToolChangePositionZ 'Goes back to a safe Z
While IsMoving()
Sleep 100
Wend

Code "G" &CurrentOffset "G90 G0 X" &PreviousX " Y" &PreviousY 'Goes back to previous X and Y positions
While IsMoving()
Sleep 100
Wend

Code "Z" &PreviousZ 'Goes to back to previous Z position
While IsMoving()
Sleep 100
Wend

' And finally replace old modal modes
Code &CurrentIncrOrAbs ' Replace old value for G90 or G91
Code "F" &CurrentFeed

Else ' GetOemLed (825) != 0

Code "(Tool sensor is grounded, check connection and try again)" 'Is it possible to pop a MessageBox instead ?
Exit Sub

End If

' Finished !

In bold where I specifically need help.

Best regards.
 
O

Otatiaro

Compagnon
Mhhhh ...

Serching in Mach wiki for some OEM DRO's, I've seen that :

Current Tool length DRO 836
Tool number DRO 824

That means I can write that code :

SetOEMDRO(824, MyCalculatedToolLengthOffset)

To get the Tool Length be set automatically ?

That would be perfect ... changing tool length without changing G54 Z offset !

I got to play with these things this WE ...

++
 
L

la_coterie

Ouvrier
anglais? :smt108 ok, j'essayerais

t'as vu >>>
palpeur-d-outil-t1808.html
il y a du code la.

1. think you are making things too complicated
2. you're trying to re-invent the wheel
3. I'm no expert, but have done this with my router
4. it's a long time since I've had the chance to use Mach.. :cry:

Here's how I use the macro in the above link.
first the screeen needs to have a few extras added... a button to press to make the macro work, a dro for the plate probe thickness and a dro for the touch speed

So

In fact it is not really necessary to reference machine, just move tool to zero position and press zero X etc...

put probe plate on work press macro button and at the end tool zero will be the surface of the work - go machine with this tool.....
machine stops at tool change - change tool and press macro button...
that's how it works, I've left out some details on the macro & where it's put etc... because I'll have to remember... :roll:
 
O

Otatiaro

Compagnon
Salut,

la_coterie a dit:
anglais? :smt108 ok, j'essayerais

t'as vu >>>
palpeur-d-outil-t1808.html
il y a du code la.

1. think you are making things too complicated
2. you're trying to re-invent the wheel
3. I'm no expert, but have done this with my router
4. it's a long time since I've had the chance to use Mach.. :cry:

Here's how I use the macro in the above link.
first the screeen needs to have a few extras added... a button to press to make the macro work, a dro for the plate probe thickness and a dro for the touch speed

So

In fact it is not really necessary to reference machine, just move tool to zero position and press zero X etc...

put probe plate on work press macro button and at the end tool zero will be the surface of the work - go machine with this tool.....
machine stops at tool change - change tool and press macro button...
that's how it works, I've left out some details on the macro & where it's put etc... because I'll have to remember... :roll:

L'anglais c'est pas ta langue natale ? ? ?

Bon ben je reprend en francais alors :wink:

Pour les choses compliquées, oui, j'aime ca :D (en plus je suis informaticien, pour une fois que je peux programmer quelque chose pour ma CNC, je vais pas me gener :wink: ).

J'ai fais quelques essais hier soir, et ca me parait prometteur, par contre faut que je vois comment rajouter un écran pour mettre les infos dont j'ai besoin sans avoir a trifouiller le code a chaque fois.

Je mettrais mon code une fois que j'aurais fini.

++
 
L

la_coterie

Ouvrier
L'anglais c'est pas ta langue natale ? ? ?
It was an english joke... oh well :roll:
mais maintenant j'ai commencé le deuxième bouquin "apprendre vous-même français" :)

allez regarder ici http://www.machsupport.com/downloads.php

you need screen4 - a bit buggy so save your work often.
you will get a better response on the Mach forum than here

bon chance :wink:
 
O

Otatiaro

Compagnon
Salut,

Juste pour dire qu'entre les infos de la-coterie et ce que j'ai trouvé sur le forum de Mach Wiki, j'ai réussi a avoir exactement ce que je voulais.

Je ne modifie pas mes "work offsets" après un palpage, mais le "tool length offset".

Ca marche très bien ... si j'ai 5 min et que je trouve un trouve pour filmer, je ferais une petite vidéo de ce que ca donne.

++
 
H

hares01

Apprenti
Bonjour

Avez vous réussi finalement a faire changer la mesure de la longueur de l'outils dans Mach3 automatiquement ?

Merci
 
M

Manuforg

Ouvrier
Slt.
Je suis également a la recherche d'une base d'un macro permettant le changement d'outil avec une Kress.
Je sais éditer le macro afin de l'adapter a ma machine.
Merci.
Manu.
 
C

chtipanda

Apprenti
idem
ce code pourrais aussi fonctionné sous linux cnc ?
 
M

Manuforg

Ouvrier
chtipanda

J'ai créé cette macro qui palpe une fois l'outil déjà dans la tête, tu change l'outil, et tu palpe le nouveau outil.
J'utilise cette macro lorsqu'il y a un changement d'outil dans un programme.
Pour l'utiliser il te faut la page "Palpeur" de la version FR de Mach3.

POSPALPX = GETOEMDRO(1010)
POSPALPY = GETOEMDRO(1011)
DECPALPX = GETOEMDRO(1020)
DECPALPY = GETOEMDRO(1021)
POSCOX = GETOEMDRO(1010)
POSCOY = GETOEMDRO(1011)
PALPX = POSPALPX + DECPALPX
PALPY = POSPALPY + DECPALPY
VPALP = GETOEMDRO(1060)
HSECU = GETOEMDRO(1051)
CODE "G00 G53 Z0"
While ISMOVING()
Wend
CODE "G00 G53 X"& PALPX &" Y"& PALPY
While ISMOVING()
Wend
MsgBox("PRET?")
CODE "G31 Z-200 F1000"
While ISMOVING()
Wend
ZUP = GETOEMDRO(802) + HSECU
CODE "g0z" & ZUP
CODE "G31 Z-200 F"& VPALP
While ISMOVING()
Wend
ZPALP = GETOEMDRO(85)
CODE "g00 g53 z0"
While ISMOVING()
Wend
CODE "G00 G53 x" & POSCOX & "y" & POSCOY
While ISMOVING()
Wend
MsgBox("CHANGEZ L'OUTIL ET APPUYEZ SUR OK")
CODE "G00 G53 X"& PALPX &" Y"& PALP
While ISMOVING()
Wend
CODE "G31 Z-200 F1000"
While ISMOVING()
Wend
ZUP = GETOEMDRO(802) + HSECU
CODE "g0z" & ZUP
While ISMOVING()
Wend
CODE "G31 Z-200 F"& VPALP
While ISMOVING()
Wend
ZPALP2 = GETOEMDRO(85)
DIFF = ZPALP - ZPALP2
ANCIENZ = GETOEMDRO(802)
NOUVEAUZ = ANCIENZ + DIFF
SETOEMDRO(802,NOUVEAUZ)
SLEEP(250)
CODE "g0 g53 z0"
While ISMOVING()
Wend


Manu
 
W

wilf39

Nouveau
Bonjour à tous

est ce quelqu'un saurait comment dire à cette macro que si le tool=0 alors prendre d'outil demandé .
car sur ma machine qui à un atc avec un magasin de 4 outils. le programme lui demande le T3 elle procède comme si elle avait déjà un outil t1 alors qu'il n'y a rien dans le nez de broche.

voici la macro qui est dans le M6Start.m1s

'ToolChange Macro For Bed type tool changer 11/05 Brian
Sub Main()
OldTool = GetOEMDRO (1200) 'Tool In spindle DRO You must add this to your settings screen
x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
tool = GetSelectedTool()
NewTool = tool
'Tool Changer Macro (Bed Type)
MaxToolNum = 4 'Max number off tools for the changer
ToolDown = -233 'Z Pos to Get or drop a tool
ToolUp = -30 'Z Hieght to Rapid from tool to tool
If NewTool = OldTool Then
Exit Sub
End If
While NewTool > MaxToolNum
NewTool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend
Code "G00 G53 Z" & ToolUp
While IsMoving()
Wend
Call MovePos(OldTool)
While IsMoving()
Wend
Code "G53 Z" & ToolDown
Code "G4 P.75"
While IsMoving()
Wend
ActivateSignal(Output1) 'Turn On Draw bar to release the tool
Code "G4 P1.0" 'Wait for the tool to release
'SystemWaitFor (7) 'Wait for the tool Release Limit switch
Code "G53 Z" & ToolUp
Call MovePos(NewTool)
While IsMoving()
Wend
Code "G53 Z" & ToolDown
Code "G4 P.75"
While IsMoving()
Wend
DeActivateSignal(Output1) 'Turn Off Draw bar to Clamp the tool
Code "G4 P1.0" 'Wait for the tool to Clamp
While IsMoving()
Wend
Code "G53 Z" & ToolUp
Call SetUserDRO (1200,NewTool)
SetCurrentTool( NewTool )
Code "G00 X" & x & " Y" & y 'Move back to where the tool change was prompted
End Sub

Sub MovePos(ByVal ToolNumber As Integer)

Select Case ToolNumber
Case Is = 1
Xpos = 12.00
YPos = 2.00
Case Is = 2
Xpos = 14.00
YPos = 2.00
Case Is = 3
Xpos = 16.00
YPos = 2.00
Case Is = 4
Xpos = 18.00
YPos = 2.00
Case Is = 5
Xpos = 12.00
YPos = 4.00
Case Is = 6
Xpos = 14.00
YPos = 4.00
Case Is = 7
Xpos = 16.00
YPos = 4.00
Case Is = 8
Xpos = 18.00
YPos = 4.00
End Select

Code "G53 X" & XPos & " Y" & YPos
End Sub
Main


en vous remercient d'avance pour vos réponses.
a bientôt wilf
 

Sujets similaires

PL50
Réponses
14
Affichages
1 071
Squal112
Squal112
N
Réponses
2
Affichages
760
NicolasC1975
N
L
Réponses
1
Affichages
501
dh42
dh42
B
Réponses
3
Affichages
1 012
dh42
C
Réponses
25
Affichages
7 955
pascalp
P
G
Réponses
1
Affichages
507
Greg de Nîmes
G
PL50
Réponses
11
Affichages
651
dh42
R
Réponses
3
Affichages
972
Pierro67
P
L
Réponses
11
Affichages
1 608
lecoyote
L
M
Réponses
12
Affichages
930
Michael87
M
Bilturn
Réponses
6
Affichages
1 115
O
C
Réponses
5
Affichages
491
christt4
C
Haut