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 26, 2012, 05:36:09 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
M6 - Turret not picking up signal correctly
Pages:
1
Go Down
« previous
next »
Author
Topic: M6 - Turret not picking up signal correctly (Read 510 times)
0 Members and 2 Guests are viewing this topic.
chudson
Holding
Offline
Posts: 1
M6 - Turret not picking up signal correctly
«
on:
August 04, 2010, 03:10:17 PM »
Hi Guys, first post here. I have built a VB script based on a few examples and other works to work with my Denford Mirac.
It has an 8 station tool changer and the position is identified using grey code - 3 digits , 1s or 0s (on or off)
The problem I'm having is I can only get positions 1 to 6 and when I try to get the positions that work they take around 5 minutes to even find the tool sometimes(spins round a few times, backs in as it thinks it has the tool, spins out as it releases it doesnt over and over). Positions 7 and 8 are 111 and 000 and for some reason the tool changer cant get those postions, it does stop on them but decides its not the tool were looking for. I have verfied the hardware is correct and working properly (I have 3 leds representing the grey code so I can see it visually). It surley can only be the code or Mach3.
Heres the code:
Dim Tool As Integer
Dim OldTool As Integer
Dim NewTool As Integer
Dim MaxToolNum As Integer
NewTool = 10
MaxToolNum = 8 'Maximum positions on Automatic Tool Changer
Tool = GetSelectedTool() 'Get the toolnumber from the command e.g T0101 M6 Tool number 1
OldTool = GetCurrentTool() 'Get current tool number
Call StartToolChanger
While NewTool <> Tool
Call CheckPins
Wend
'//// Subroutines /////////
Sub StartToolChanger
ActivateSignal(Output3) 'Turn on output signal to turn off spindle and turn on the atc
ActivateSignal(Output4) 'Turn atc forward
sleep 3000 'Needed to start atc otherwise it plays up
Call CheckPins
End Sub
Sub CheckPins
If IsActive(Input3) And Not IsActive(Input2) And Not IsActive(Input1) Then
NewTool = 1
Call StopTool
End If
If Not IsActive(Input3) And Not IsActive(Input2) And Not IsActive(Input1) Then
NewTool = 8
Call StopTool
End If
If Not IsActive(Input3) And Not IsActive(Input2) And IsActive(Input1) Then
NewTool = 4
Call StopTool
End If
If IsActive(Input3) And Not IsActive(Input2) And IsActive(Input1)Then
NewTool = 5
Call StopTool
End If
If IsActive(Input3) And IsActive(Input2) And IsActive(Input1) Then
NewTool = 7
Call StopTool
End If
If Not IsActive(Input3) And IsActive(Input2) And IsActive(Input1)Then
NewTool = 6
Call StopTool
End If
If Not IsActive(Input3) And IsActive(Input2) And Not IsActive(Input1) Then
NewTool = 2
Call StopTool
End If
If IsActive(Input3) And IsActive(Input2) And Not IsActive(Input1) Then
NewTool = 3
call StopTool
End If
End Sub
Sub Stoptool
DeActivateSignal(Output4) ' Stop running the ATC forward, if you don't do this the inverter will stop and the whole unit
' Will need to be turned off and on again
ActivateSignal(Output5) 'Run ATC in reverse
Sleep 3000 'Wait 3 seconds to allow the toolpost to lock in
DeActivateSignal(Output5) 'Stop running ATC in reverse
Sleep 1000
If Tool <> NewTool Then
Call StartToolChanger
SetCurrentTool(NewTool)
Else
SetCurrentTool(NewTool)
End If
DeActivateSignal(Output3) 'Turn off output to turn spindle back on
Stop
End Sub
Logged
BR549
Active Member
Offline
Posts: 2,553
Re: M6 - Turret not picking up signal correctly
«
Reply #1 on:
August 04, 2010, 06:48:09 PM »
I 'll give you some experience from a group of us that worked on tool changer code inside of mach. IT is a bear. Mach is very slow in VB macros and to get any speed out of the tool changer was tough as well.
The grey code(we had a 24 tool changer running) is a challenge to VB because of the slow i/o loop) Never was able to get it to run FAST enought to make it usefull so we went to a ModIO from Peter Holmann instead. A plc would be best as we know that works well.
What seems to happen is as the positions come up mach is not fast enought to interegate the code in time to stop the changer on position. By the time it does the complete logic loop the grey code has changed and the loop has to restart. Then it becomes hit a miss to catch the position in time to process it.
Things that can help. ADD another triggerpoint(switch) that activates at each station. Then force the changer to STOP until Mach can interegate the grey code. Then based on what it sees stop or continue. An 8 station changer would not be too bad but a 24 was painfully SLOW and clunky.
Now this is NOT saying it can't be made to work, you will just have to work out the variables based on YOUR system. You will have to work out a system that mach can deal with. I think a BRIANS approach could be made to work nicely. Let the brain do the logic loop and signal VB to process the results.
A plugin would be best (faster) but harder to impliment.
This was our results, Your mileage may vary
«
Last Edit: August 04, 2010, 06:50:29 PM by BR549
»
Logged
BR549
Active Member
Offline
Posts: 2,553
Re: M6 - Turret not picking up signal correctly
«
Reply #2 on:
August 05, 2010, 10:39:47 AM »
Another thought, can you make the dwell longer on your encoder for the grey code? that would give mach more time to see it. I looked at your code and it seems ok up front with simple testing Just need to work out the timing issues with the encoder and VB. With your mechanism you should be able to stretch the encoder signal out to JUST before the next tool position as you do a back down to lock it in it would just take a bit longer to back down
The Brians are much faster BUT I don't see a fast way to access VB from the brians. and you end up with the same problem
«
Last Edit: August 05, 2010, 10:42:40 AM by BR549
»
Logged
BR549
Active Member
Offline
Posts: 2,553
Re: M6 - Turret not picking up signal correctly
«
Reply #3 on:
August 05, 2010, 08:52:53 PM »
IF you get a change try the code something like this to see IF it is any faster.
'Macro Tool Changer
Sub Main()
Dim Tool As Integer
Dim OldTool As Integer
Dim NewTool As Integer
Dim MaxToolNum As Integer
NewTool = 10
MaxToolNum = 8 'Maximum positions on Automatic Tool Changer
Tool = GetSelectedTool() 'Get the toolnumber from the command e.g T0101 M6 Tool number 1
OldTool = GetCurrentTool() 'Get current tool number
If Tool > MaxtoolNum Then GoTo 6
If TOOL = OldTool Then GoTo 7
ActivateSignal(Output3) 'Turn on output signal to turn off spindle and turn on the atc
sleep(10)
ActivateSignal(Output4) 'Turn atc forward
sleep (3000) 'Needed to start atc otherwise it plays up
While NewTool <> Tool
' CheckPins
If IsActive(Input3) And Not IsActive(Input2) And Not IsActive(Input1) Then
NewTool = 1
GoTo 5 'StopTool
End If
If Not IsActive(Input3) And Not IsActive(Input2) And Not IsActive(Input1) Then
NewTool = 8
GoTo 5 'StopTool
End If
If Not IsActive(Input3) And Not IsActive(Input2) And IsActive(Input1) Then
NewTool = 4
GoTo 5 'StopTool
End If
If IsActive(Input3) And Not IsActive(Input2) And IsActive(Input1)Then
NewTool = 5
GoTo 5 'StopTool
End If
If IsActive(Input3) And IsActive(Input2) And IsActive(Input1) Then
NewTool = 7
GoTo 5 'StopTool
End If
If Not IsActive(Input3) And IsActive(Input2) And IsActive(Input1)Then
NewTool = 6
GoTo 5 'StopTool
End If
If Not IsActive(Input3) And IsActive(Input2) And Not IsActive(Input1) Then
NewTool = 2
GoTo 5 'StopTool
End If
If IsActive(Input3) And IsActive(Input2) And Not IsActive(Input1) Then
NewTool = 3
GoTo 5 'StopTool
End If
Wend
5:
' Stoptool
DeActivateSignal(Output4) 'StopATC
sleep(10)
ActivateSignal(Output5) 'Run ATC in reverse
Sleep (3000) 'Wait 3 seconds to allow the toolpost to lock in
DeActivateSignal(Output5) 'Stop running ATC in reverse
Sleep (1000)
SetCurrentTool(NewTool)
DeActivateSignal(Output3) 'Turn off output to turn spindle back on
sleep(10)
GoTo 7
6:
MsgBox ("Tool out of RANGE")
Goto 7
7:
End Sub
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...