Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 28, 2012, 02:15:46 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
VB and the development of wizards
Macro for automatic tool changer (ATC) in the script M6Start with two axis
Pages:
1
Go Down
« previous
next »
Author
Topic: Macro for automatic tool changer (ATC) in the script M6Start with two axis (Read 528 times)
0 Members and 2 Guests are viewing this topic.
Marco A
Active Member
Offline
Posts: 4
Macro for automatic tool changer (ATC) in the script M6Start with two axis
«
on:
September 01, 2011, 11:18:44 AM »
'**************************************************************************
'* Macro for automatic tool changer (ATC) in the script M6Start.m1s
'* with two axis moving the ATC.
'*
'* Description:
'*
'* We used two axis (B-Axis and C-Axis) to move two motors, one motor
'* is used to move the ATC (with the B-axis). And, the C-axis
'* (The second motor) is used to rotate the ATC and select the tool.
'* It is used one out (output1) to hold or relase the tool, when it is
'* necessary.
'*
'* Process:
'*
'* 1. Z-axis goes to "Z zero".
'* 2. Then, Z-axis moves to the height of the ATC.
'* 3. The ATC comes to a programed position with the B-axis, and takes
'* the tool.
'* 4. The output1 relases the tool and Z-axis goes up.
'* 5. Whith the C-axis we rotate the ATC to the new tool.
'* 6. The Z-axis goes down and holds the tool activating Output1.
'* 7. The ATC returns to the start position and Z-axis returns to
'* home.
'*
'*
'* Caution:
'*
'* It is necessary consider two inputs for home, one for
'* each axis (C and B) Because they need a start position to know
'* when the ATC takes the tool or where is each tool.
'* Also is necessary to edit the button´s script "Ref all home" with
'* the code "DoButton( 25 ), DoButton( 26 )", letting ATC found a
'* start position, and in the menu "General Config" indicate that
'* axis B and C works like rotative axis.
'* The units of the axis B and C are in degrees.
'*
'* Marco A Perez C.
'* Sadosa S.A. de C.V.
'*
'* '**************************************************************************
Sub Main() 'Definir variables
OldTool = GetOEMDRO (1200)
x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
tool = GetSelectedTool()
NewTool = tool
MaxToolNum = 5 'Maximum number of tools to use.
ToolDown = -50 'Height for tool change.
ToolUp = 0.0 'Height the Z-axis during tool change.
If NewTool = OldTool Then
Exit Sub
End If
While NewTool > MaxToolNum
NewTool = Question ("Place valid tool number (1 to 5)")
Wend
Call MovePos(OldTool) 'The ATC identifies the old tool.
While IsMoving()
Wend
Code "G53 Z" & ToolDown 'The Z-axis goes to ATC height
Code "G4 P.75"
While IsMoving()
Wend
Code "G00 G53 B1.0" 'The ATC moves to Z-axis and takes the tool
While IsMoving()
Wend
ActivateSignal(Output1) 'Send signal to relase tool.
Code "G4 P1.0" 'Wait a second.
Code "G53 Z" & ToolUp 'The Z-axis goes up and waits here.
Call MovePos(NewTool) 'The ATC moves to the new tool.
While IsMoving()
Wend
Code "G53 Z" & ToolDown 'Z-axis moves down and takes the tool
Code "G4 P.75"
While IsMoving()
Wend
DeActivateSignal(Output1) 'Send signal to hold tool.
Code "G4 P1.0" 'wait a second.
While IsMoving()
Wend
Code "G00 G53 B0.0" 'The ATC returns to start position.
While IsMoving()
Wend
Code "G53 Z" & ToolUp 'The Z-axis up, and it's ready to use.
Call SetUserDRO (1200,NewTool)
SetCurrentTool( NewTool )
End Sub
Sub MovePos(ByVal ToolNumber As Integer)
Select Case ToolNumber 'Positions to each tool in C-axis
Case Is = 1
Code "G00 G53 C1.0"
Case Is = 2
Code "G00 G53 C2.0"
Case Is = 3
Code "G00 G53 C3.0"
Case Is = 4
Code "G00 G53 C4.0"
Case Is = 5
Code "G00 G53 C5.0"
Case Is = 6
Code "G00 G53 C6.0"
Case Is = 7
Code "G00 G53 C7.0"
Case Is = 8
Code "G00 G53 C8.0"
End Select
End Sub
Main
Logged
Marco A
Active Member
Offline
Posts: 4
Re: Macro for automatic tool changer (ATC) in the script M6Start with two axis
«
Reply #1 on:
September 01, 2011, 11:19:54 AM »
'**********************************************************************************
'*
'* Macro para intercambiador de herramientas automático del script M6Start.m1s
'*
'* Descripción:
'*
'* Se usan dos ejes el B y C para mover dos motores,
'* El eje B se usa para acercar o alejar el carrusel de herramientas;
'* El eje C se usa para girar el carrusel y seleccionar la herramienta deseada;
'* adicional mente se utiliza una saluda (Output1) para sujetar o soltar la herramienta.
'*
'* Procedimiento:
'*
'* 1. Se manda al eje Z a casa.
'* 2. El eje Z es posicionado a la altura del carrusel de herramientas.
'* 3. Se acerca el carrusel con una posición dada al eje B y toma la herramienta..
'* 4. Se suelta la herramienta con Output1 y sube el eje Z.
'* 5. Con el eje C se gira el carrusel de herramientas.
'* 6. El eje Z baja y toma la herramienta con Output1.
'* 7. Se aleja el carrusel de herramientas y el eje Z vuelve a casa.
'*
'* Advertencia:
'*
'* Para estar seguro que el eje C y B no se muevan y pierdan su posición
'* es necesario colocar limites de casa y habilitarlos en "ports and pins",
'* además se debe editat el script del boton "Ref all home" colocandole las siguientes
'* dos líneas al final "DoButton( 25 )" y "DoButton( 25 )", esto para que busque casa
'* de esos ejes cuando se mande a casa toda la máquina.
'*
'*
'* Sadosa S.A. de C.V.
'*
'* ********************************************************************************
Sub Main() 'Definir variables
OldTool = GetOEMDRO (1200) 'Tomar el valor de la herramienta actual.
x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
tool = GetSelectedTool()
NewTool = tool
MaxToolNum = 5 'Número máximo de herramientas que se puede utilizar.
ToolDown = -50 'Posición de Z a la altura del carrusel de herramientas.
ToolUp = 0.0 'Posición de Z arriba del carrusel.
If NewTool = OldTool Then
Exit Sub
End If
While NewTool > MaxToolNum
NewTool = Question ("Ingresa nùmero de herramienta vàlido (Entre 1 y 5)")
Wend
Call MovePos(OldTool)
While IsMoving()
Wend
Code "G53 Z" & ToolDown
Code "G4 P.75"
While IsMoving()
Wend
Code "G00 G53 B1.0"
While IsMoving()
Wend
ActivateSignal(Output1) 'Mandar señal para soltar herramienta
Code "G4 P1.0" 'Espera mietras se suelta la herramienta
Code "G53 Z" & ToolUp
Call MovePos(NewTool)
While IsMoving()
Wend
Code "G53 Z" & ToolDown
Code "G4 P.75"
While IsMoving()
Wend
DeActivateSignal(Output1) 'Mandar señal para sostener la herramienta
Code "G4 P1.0" 'Tiempo de espera para sostener la herramienta
While IsMoving()
Wend
Code "G00 G53 B0.0"
While IsMoving()
Wend
Code "G53 Z" & ToolUp
Call SetUserDRO (1200,NewTool)
SetCurrentTool( NewTool )
End Sub
Sub MovePos(ByVal ToolNumber As Integer)
Select Case ToolNumber 'Posiciones del eje C donde se encuentra cada herramienta
Case Is = 1
Code "G00 G53 C1.0"
Case Is = 2
Code "G00 G53 C2.0"
Case Is = 3
Code "G00 G53 C3.0"
Case Is = 4
Code "G00 G53 C4.0"
Case Is = 5
Code "G00 G53 C5.0"
Case Is = 6
Code "G00 G53 C6.0"
Case Is = 7
Code "G00 G53 C7.0"
Case Is = 8
Code "G00 G53 C8.0"
End Select
End Sub
Main
Logged
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...