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 27, 2012, 10:58:41 PM
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
M6Start for Toolchanger again.
Pages:
1
2
»
Go Down
« previous
next »
Author
Topic: M6Start for Toolchanger again. (Read 933 times)
0 Members and 1 Guest are viewing this topic.
Oldraven
Active Member
Offline
Posts: 24
M6Start for Toolchanger again.
«
on:
June 07, 2011, 06:43:22 AM »
Hi ,
I used a M6Start macro that someone had written for a 6 tool Boxford ATC.
That worked, sort of, for my Emco5 ATC converted with a stepper motor and one optical slot for homing.
The problem was that the macro could not see if the ATC was homed in the Manual screen, Home All.
It would turn at random, tool positions were not absolute.
I inserted this piece of VB code in the beginning of the macro;
'----------------------------------------
' First check if ATC is homed.
If IsActive(INPUT1) Then
Message " Input 1 is Active"
SensorState = "Active"
Else
Message " Input 1 is NOT Active, Home first."
Code "M30" 'End the execution of the G-Code.
End
End If
If SensorState = "Active" Then
Current_Tool = 1 'Set ATC Home as Current Tool.
End If
'-----------------------------------------
That set the Current_Tool as tool # one.
But, when a second tool change was asked for in the G-code things went wrong.
The macro insists to be homed again.
I need some code or place to store the information that the part homing command is to be skipped.
Say that I insert a variable like Homing_Done just before the end If;
If SensorState = "Active" Then
Current_Tool = 1 'Set ATC Home as Current Tool.
Homing_Done = 1
End If
I want to store this Homing_Done somewhere. Can that be done outside the macro and have the macro look for it each time the M6Start
is called in the current G-code?
This is the total macro;
' Boxford 160TCL Toolchanger Macro.
'
' Works by turning CW to just past the tool position
' and then CCW into a stop.
' Axis setup as rotary e.g. move 360 = 1 full turn.
' Adapted for the EMCO5cnc Automatic Tool Changer.
' Checks if ATC is Homed first and sets Current_Tool as #1.
' If not Homed it ends the program.
If IsLoading() Then
' Do Nothing, program loading
Else
' Dim Variables
Dim Num_Tools As Integer
Dim CW_Steps_Per_Tool As Integer
Dim CCW_Steps As Integer
Dim HoldingDRO As Integer
Dim Requested_Tool As Integer
Dim Current_Tool As Integer
Dim CW_Feed As Integer
Dim CCW_Feed As Integer
Dim moves As Integer
Dim total_move As Integer
'----------------------------------------
' First check if ATC is homed.
If IsActive(INPUT1) Then
Message " Input 1 is Active"
SensorState = "Active"
Else
Message " Input 1 is NOT Active, Home first."
Code "M30" 'End the execution of the G-Code.
End
End If
If SensorState = "Active" Then
Current_Tool = 1 'Set ATC Home as Current Tool.
End If
'-----------------------------------------
' set up some vars
Num_Tools = 6
CW_Move_Per_Tool = 360/Num_Tools
CCW_Move = 10
HoldingDRO = 1050
Requested_Tool = GetSelectedTool()
' Current_Tool = GetUserDRO(HoldingDRO)
CW_Feed = 700
CCW_Feed = 700
Current_Feed = GetOEMDRO(818)
' start tool change
Message ("Requested Tool No=" & Requested_Tool)
If Requested_Tool > Num_Tools Then
Message "Requested Tool No. too high, program stopped."
Code "M30"
End
End If
If Requested_Tool < 1 Then
Message "Requested Tool No. too low, program stopped."
Code "M30"
End
End If
If Requested_Tool = Current_Tool Then
' do nothing
Else
' lets do some changing
If Requested_Tool > Current_Tool Then moves = Requested_Tool -Current_Tool
If Requested_Tool < Current_Tool Then moves = Num_Tools - Current_Tool +Requested_Tool
total_move = (moves * CW_Move_Per_Tool)+(CCW_Move/2)
'Code "G01 x-10 F700"
'Code "z-10"
Code "G91 G94" 'incremental & Feed per minute
Code "G0 A" & total_move '& "F" & CW_Feed
Code "G0 A" & "-" & CCW_Move '& "F" & CCW_Feed
While IsMoving()
Wend
SetCurrentTool Requested_Tool
SetUserDRO HoldingDRO, Requested_Tool
Code "G90" ' back to absolute movement
Code "F" & Current_Feed
End If
End If
' end of tool change
Thanks for looking,
Jos
Holland
Logged
BR549
Active Member
Offline
Posts: 2,557
Re: M6Start for Toolchanger again.
«
Reply #1 on:
June 07, 2011, 10:30:48 AM »
There are many ways to do it. Mach has an led indicator that shows IF the axis has been refHome. Then you ask IF the led is not active then HOME else do the rest of the code.
IF you need more help just ask.
1 tip is to get rid of the END in this section as it will end the program before it gets started(;-)
If IsActive(INPUT1) Then
Message " Input 1 is Active"
SensorState = "Active"
Else
Message " Input 1 is NOT Active, Home first."
Code "M30" 'End the execution of the G-Code.
End <---------------------------------------------------------------------------------------------- Delete this piece of code
End If
If SensorState = "Active" Then
Current_Tool = 1 'Set ATC Home as Current Tool.
End If
(;-)TP
«
Last Edit: June 07, 2011, 10:48:17 AM by BR549
»
Logged
BR549
Active Member
Offline
Posts: 2,557
Re: M6Start for Toolchanger again.
«
Reply #2 on:
June 07, 2011, 11:25:57 AM »
Never mind the delte the END stament I see where you are heading(;-)
(;-) TP
Logged
Oldraven
Active Member
Offline
Posts: 24
Re: M6Start for Toolchanger again.
«
Reply #3 on:
June 07, 2011, 11:59:16 AM »
Quote from: BR549 on June 07, 2011, 11:25:57 AM
Never mind the delte the END stament I see where you are heading(;-)
(;-) TP
Yes, that was the idea. End the execution of the G-code and jump to the beginning.
That works.
I wanted to set a sort of register after the statement ; Current_tool = 1. I.E. Homing_Done = 1
But that info is lost every time M6Start is called by a subsequent tool change in the running G-code.
I need to put the info somewhere in a register so that I can have the macro look at it and determine its status.
By a second call to the tool change the macro can fetch its status and skip checking for the initial homing.
Regards,
Jos
Holland
Logged
BR549
Active Member
Offline
Posts: 2,557
Re: M6Start for Toolchanger again.
«
Reply #4 on:
June 07, 2011, 01:14:10 PM »
That would be easy to do Just use a Gcode# variable to store the homed bit value.
SetVar(300,0) would be UNhomed , The default is 0 when mach starts up.
Setvar(300,1) would be HOMED.
That way as long as MACH is running the values are held. and when you close down mach the values are not stored.
Then at the begging of the macro ask
IF GetVar(300) =0 then end the script
else continue.
(;-) TP
(;-) TP
Logged
Oldraven
Active Member
Offline
Posts: 24
Re: M6Start for Toolchanger again.
«
Reply #5 on:
June 07, 2011, 01:19:10 PM »
OK,
With this I have some direction.
I'll have a look at it tomorrow.
Shutting down for the evening it is past 8 o'clock in the evening here.
Thanks,
Jos
Logged
Promech
Active Member
Offline
Posts: 68
Re: M6Start for Toolchanger again.
«
Reply #6 on:
June 07, 2011, 10:10:14 PM »
Will be following this closely. Have also an Emco (Sauter) turret that needs to be automated. Do not know where to start. Maybe replacing the AC motor with a Stepper as is suggested here.
Logged
BR549
Active Member
Offline
Posts: 2,557
Re: M6Start for Toolchanger again.
«
Reply #7 on:
June 07, 2011, 10:14:54 PM »
IF your mechanism is sound I would develope a software solution to run it as it is. I believe it has already been done, need to do some searching.
(;-) TP
Logged
Promech
Active Member
Offline
Posts: 68
Re: M6Start for Toolchanger again.
«
Reply #8 on:
June 08, 2011, 01:21:15 AM »
The system is mechanically sound. It comes with a little A.C. motor, a proximity switch that senses 8 positions (does not know which is which), and an 8 position encoder. The A.C. motor is controlled by two contactors (forward and reverse) and it goes forward and then reverse each time it selected a tool. To figure out how the original Emco program was including all these things may be a little complicated. Plus the A.C. motor voltage is 440 V, and I do not want to mess with that voltage again because I would have to add a 220 to 440 transformer.
I am thinking about replacing the A.C. motor with a stepper or a servo and then the proximity switch and the encoder will not be necessary. Just use some type of homing so the servo knows where it is at start up and that would be all. Here it looks as you guys are discussing about a mill ATC, in my case it is an 8 position turret in a lathe, but the problem may be similar.
Thanks,
Jorge
Logged
BR549
Active Member
Offline
Posts: 2,557
Re: M6Start for Toolchanger again.
«
Reply #9 on:
June 08, 2011, 06:21:11 PM »
OK that is a simple overun system that uses an absoute (grey code) encoder to identify each stop position. I would replace the AC motor with a small DC motor. I have seen the VB code somewhere for that type of changer.
I think Peter Homann from MODIO does a great job with this style system using the Modio to do the fuzzy logic. I would give him shout. HE may have the answer already to go in one simple kit.
Just a thought, (;-) TP
Logged
Pages:
1
2
»
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...