Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2008, 09:11:28 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Denford lathe 8 position BCD (3 input slot reader), ATC M6
Pages: 1   Go Down
Print
Author Topic: Denford lathe 8 position BCD (3 input slot reader), ATC M6  (Read 512 times)
0 Members and 1 Guest are viewing this topic.
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Online Online

Posts: 770


Briceville, TN, USA



View Profile WWW
« on: July 11, 2008, 10:46:47 AM »

Here is an M6 for a 8 position Denford ATC, the kind that has a 3 input slot reader to code the position of the turret. Also, it has an output that turns on an output that runs the ATC forward at 24 volts, once it is at the correct tool position, the signal dies, and reley goes back to a 12 side that runs the turret backward and locks it, the 12 volt is always on unless moving forward for new tool.

This is from a request from a guy on the CNC zone that has this kind of set up.
Resources:
INPUTS1, 2 and 3 (sensors that read the slot pattern in the turret to code tool/slot number.
OUTPUT3 (this turns on the releay to flip over to the 24 volt opposite polarity side, to run the turret forward in a search for the next tool, it deactivates when the "3 digit" binary code from the inputs above match the Tool/slot for the new tool, it then reverses and locks into position


'M6Start.M1s

Sub Main()

NewTool = GetSelectedTool()
OldTool = GetCurrentTool()
MaxToolNum = 8 'Max number of tools for the changer

While NewTool > MaxToolNum
NewTool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend

If NewTool = OldTool Or NewTool = 0 Then
Exit Sub
End If

If OldTool <> NewTool Then
   While Slot <> NewTool
   ActivateSignal(OUTPUT3) 'start rotating forward
      If IsActive(INPUT3) And Not IsActive(INPUT2) And Not IsActive (INPUT1) Then
      Slot = 1
      End If
      If Not IsActive(INPUT3) And Not IsActive(INPUT2) And Not IsActive (INPUT1) Then
      Slot = 2
      End If
      If Not IsActive(INPUT3) And Not IsActive(INPUT2) And IsActive (INPUT1) Then
      Slot = 3
      End If
      If IsActive(INPUT3) And Not IsActive(INPUT2) And IsActive(INPUT1) Then
      Slot = 4
      End If
      If IsActive(INPUT3) And IsActive(INPUT2) And IsActive(INPUT1) Then
      Slot = 5
      End If
      If Not IsActive(INPUT3) And IsActive(INPUT2) And IsActive(INPUT1) Then
      Slot = 6
      End If
      If Not IsActive(INPUT3) And IsActive(INPUT2) And Not IsActive (INPUT1) Then
      Slot = 7
      End If
      If IsActive(INPUT3) And IsActive(INPUT2) And Not IsActive(INPUT1) Then
      Slot = 8
      End If
   Wend
   Sleep(100)
   DeActivateSignal(OUTPUT3) 'stop rotating forward, rotate backward now
End If

SetOEMDRO(824,NewTool)
Code "G4 P2"          'A pause time of 2 seconds to give your reverse turret time to seat
While IsMoving
Wend

End Sub
Main

'have fun,
'Scott 

Logged

All things Mach3, Screens, Wizards, Plugins, Brians, complete control solutions for complex machines, Macros, ATC's, any kind of CNC machine build, retrofit or repair.
fisherjim
Active Member

Offline Offline

Posts: 28


View Profile
« Reply #1 on: August 25, 2008, 12:44:45 PM »



This Macro, slightly changed to suit 4 inputs, also works on my Emco 220 lathe, but is not "safe" as I have Mach3 set up with a switch to manually revolve the turret so as to set up tools. so if the DRO is showing tool 1 and the toolchanger is actually on tool 3 if I enter "tool 1" the changer stays where it is as the control thinks its still on tool 1.
Is there a way to dynamically update the tool number on the DRO as the changer goes round or should I throw away the switch?  Huh

Jim.
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!