Loading ...
Sorry, an error occurred while loading the content.

Denford Orac Lathe Toolchange Macro

Expand Messages
  • Corey
    I got my hands on a toolchange Macro written for a Denford Orac Turret. The logic in my turret (1990) is slightly different from what was posted, so I had to
    Message 1 of 3 , Feb 27, 2012
    • 0 Attachment
      I got my hands on a toolchange Macro written for a Denford Orac Turret. The logic in my turret (1990) is slightly different from what was posted, so I had to adjust it.

      I've got two issues currently. First, the sensor state changes the moment the turret reaches the new position, and NOT after triggering the ratchet (this turret needs to over-run slightly). So, for me, it rotates to the correct tool then backs up all the way to the previous tool. So it looks like I need a timing delay enabled in my version. Others will not need this depending on the alignment of their sensor disc and tool turret. Second, for the Macro to work, I have to type M6T0202 to get the turret to index. If I type T02 or M6T02, it triggers for a fraction of a second and does not rotate any noticeable amount. I need to figure out why. Finally, I want the macro to verify that the toolchanger is in the correct position BEFORE exiting. As it now stands, if it think's it's in the correct position (triggered the correct sequence, but didn't lock) it returns control to Mach and obviously, bad things could happen. I want it to either trigger an error code, or try again. Here is my current version of Max's macro.

      I have removed the leading apostrophe in this line with no change. How do I enable a delay?

      'Code "G4 P4.0" 'Wait for the tool to rotate past the sensor

      thanks,
      v

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

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

      Call StartTool

      While SelectedTool <> NewTool
      Call CheckPins
      Wend

      SelectedTool = NewTool

      Call StopTool

      SetCurrentTool(NewTool )

      '//// Subroutines /////////

      Sub StartTool
      ActivateSignal(Output3)
      'Code "G4 P4.0" 'Wait for the tool to rotate past the sensor
      While Ismoving()
      Wend
      End Sub


      Sub CheckPins
      If Not IsActive(Input1) And Not IsActive(Input2) And IsActive(Input3) Then
      SelectedTool = 1
      End If
      If IsActive(Input1) And Not IsActive(Input2) And IsActive(Input3) Then
      SelectedTool = 2
      End If
      If IsActive(Input1) And IsActive(Input2) And IsActive(Input3) Then
      SelectedTool = 3
      End If
      If Not IsActive(Input1) And IsActive(Input2) And IsActive(Input3) Then
      SelectedTool = 4
      End If
      If Not IsActive(Input1) And IsActive(Input2) And Not IsActive(Input3) Then
      SelectedTool = 5
      End If
      If IsActive(Input1) And IsActive(Input2) And Not IsActive(Input3) Then
      SelectedTool = 6
      End If
      If IsActive(Input1) And Not IsActive(Input2) And Not IsActive(Input3) Then
      SelectedTool = 7
      End If
      If Not IsActive(Input1) And Not IsActive(Input2) And Not IsActive(Input3) Then
      SelectedTool = 8
      End If
      End Sub

      Sub Stoptool
      DeActivateSignal(Output3)
      End Sub
    • Corey
      Ok, the line: Code G4 P4.0 Wait for the tool to rotate past the sensor appears to be crap. The correct way to call for a delay in VBscript is: sleep(xx)
      Message 2 of 3 , Feb 27, 2012
      • 0 Attachment
        Ok, the line:

        'Code "G4 P4.0" 'Wait for the tool to rotate past the sensor

        appears to be crap. The correct way to call for a delay in VBscript is:

        sleep(xx)

        Where xx is the delay in milliseconds. I have the script running correctly on my turret with a 700ms delay after the sensor trips. I'm going to make some other changes to guarantee that he turret is locked in the correct position before relinquishing control. I still need to know why the toolchange command needs to be in the form M6T0606. Please speak up if you know how to fix this. I'll post an improved macro in a day or two.

        cheers,
        v

        --- In mach1mach2cnc@yahoogroups.com, "Corey" <vandal968@...> wrote:
        >
        > I got my hands on a toolchange Macro written for a Denford Orac Turret. The logic in my turret (1990) is slightly different from what was posted, so I had to adjust it.
      Your message has been successfully submitted and would be delivered to recipients shortly.