Hello Guest it is April 16, 2024, 07:30:18 PM

Author Topic: Lathe Turret Macro  (Read 9754 times)

0 Members and 1 Guest are viewing this topic.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Lathe Turret Macro
« Reply #10 on: December 17, 2011, 04:36:50 AM »
Not sure if backlash works in Rotational Axis, never tried it. If I get a chance (and remember ;) ) I will see if I can test it out. I was going to be using it on my spindle when I used SwapAxis() for rigid tapping but I got a floating holder at a good price so never bothered.
Hood
Re: Lathe Turret Macro
« Reply #11 on: December 17, 2011, 06:31:28 PM »
Thanks for the reply Hood. Any idea why the "Ang short rot on G0" option does not stop the turret from turning both ways?

Kevin

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Lathe Turret Macro
« Reply #12 on: December 17, 2011, 06:38:51 PM »
It shouldnt, maybe attach your xml and I will test here
Hood
Re: Lathe Turret Macro
« Reply #13 on: December 18, 2011, 03:26:39 PM »
Here is my .xml file. Hopefully you can tell something from it. Thanks again for the help, Hood! The forum is lucky to have people like you.

Kevin

Offline Graham Waterworth

*
  • *
  •  2,671 2,671
  • Yorkshire Dales, England
    • View Profile
Re: Lathe Turret Macro
« Reply #14 on: December 18, 2011, 03:57:59 PM »
The problem is you are using absolute g-code for the A axis,  change the g-code to work in incremental moves.

Without engineers the world stops
Re: Lathe Turret Macro
« Reply #15 on: December 18, 2011, 04:32:52 PM »
How would I do that? My current macro is posted at the start of this thread. I'm using absolute positioning so that the turret arrives at the same place every time. To do it incrementally, how do I make the macro calculate the required number of degrees to arrive at the commanded position?

Thanks for your reply!

Kevin

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Lathe Turret Macro
« Reply #16 on: December 18, 2011, 05:26:54 PM »
Yes seems thats the issue, you would need to take the G53 out of the macro. You would have to make sure that the A was zero in work offset coords when you home.
Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Lathe Turret Macro
« Reply #17 on: December 19, 2011, 08:45:45 AM »
Backlash on A doesnt seem to be working with the SS from what I can see.
Hood

Offline Graham Waterworth

*
  • *
  •  2,671 2,671
  • Yorkshire Dales, England
    • View Profile
Re: Lathe Turret Macro
« Reply #18 on: December 19, 2011, 10:51:12 AM »
The tool change routine would look something like this :-

Dim new_tool As Integer
Dim old_tool As Integer
Dim move_a As Integer
Dim a_angle As Integer

new_tool=GetSelectedTool()
old_tool=GetCurrentTool()
a_angle=45

If new_tool>0 And new_tool <9 Then
  If old_tool <> new_tool Then
    move_a = 8 - old_tool + new_tool
    move_a = move_a Mod 8
    move_a = move_a * a_angle
    ActivateSignal(OutPut7)
    Sleep 500
    Code "G00 G91 A" & move_a
    While IsMoving()
    Wend
    DeActivateSignal(OutPut7)
    Code "G90"
    SetCurrentTool(new_tool)
  End If
End If



Graham
« Last Edit: December 19, 2011, 11:54:00 AM by Graham Waterworth »
Without engineers the world stops
Re: Lathe Turret Macro
« Reply #19 on: December 21, 2011, 01:02:24 AM »
Thanks for the replies guys. I haven't had a chance to try out the new Macro, but I did remove the G53 from the exisiting one which so far seems to work fine. Upon further thought, the best solution would be one that ran in both directions, but when moving in "reverse" would move a couple degrees past the required position and then back up to take up the lash. But for now, the current macro works, and I'm happy.

I'll be trying the new macro in the next day or two and I'll let you know how it works.

Thanks again!

Kevin