Hello Guest it is April 26, 2024, 11:34:52 AM

Author Topic: Mach 3 atc on boxford lathe  (Read 2410 times)

0 Members and 1 Guest are viewing this topic.

Mach 3 atc on boxford lathe
« on: April 15, 2023, 02:18:02 PM »
hi all
apologies as i realise this subject has prob been done to death..
i have a new to me boxford lathe with an 8 position atc and running mach3. guy i bought it from said it all worked fine. for multiple reasons i didnt get to try it and bought it anyway.  ::)
everything works well (mostly) except the turret. i have checked the macro in the m6start folder in mach3 turn.
it doesnt work, if i manually drive the atc and set the a axis (i have screen sets for a axis) to tool 01 and zero the a axis out (zero world a) and then type T0202 to move to tool 02 offset 02 it skips past position 02, to an unknown location between tool 02 and tool 03.
this atc has a ratchet i believe so it has to go past the location and then back a small amount to lock in place. it does use g91 for this to avoid losing steps..?
also if i am at say t0606 position and i enter t0101 in the mdi line it tries to go clockwise against the ratchet which just stalls the motor.
i copied a macro from this site which works ok, it moves the atc in 45deg increments but it doesnt allow for the atc to move back a couple of degrees to lock the turret on the pin...

this is the macro below that came already in the m6start folder:

'This macro drives an 8 position stepper driven ATC.
'It drives forward past a ratchet, then backwards a little to stall the motor
'The A axis is setup for 20 steps per mm, my ATC requires 900 steps per index
'of 45 degrees.
'Because of the stall, steps are lost. So, we switch to INC mode for the ATC,
'then back to ABS mode before we exit.


'OEMDRO(803) is utilized to store the last used tool (OldTool) and is updated
'upon final execution of the macro. This is resorted to as the Txxyy will overwrite
'the "CurrentTool" DRO.
'The A axis is zeroed if tool is Number1, to prevent an overflow of the DRO after
'multiple changes.


'M6Start.m1s
Message ("macro running")

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

If OldTool = Tool Then
Message ("Selected Tool already loaded")
Exit Sub
End If

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

xval= getoemdro(800)   'get x
zval= getoemdro(802)   'get z
Call Dooembutton(138)
While IsMoving()
Wend


moveto = Tool- OldTool

If moveto<1 Then moveto=8+moveto

code "G91"   'inc mode

code "G00 A"+Str((moveto*45)+5)
While IsMoving()
Wend


code "G00 A-5"
While IsMoving()
Wend

code "G01 A-2 F100"
While IsMoving()
Wend

code "G90"   'abs mode

NewTool=Tool
If NewTool=1 Then
Call DoOemButton (1011)      'zero A
End If


Call SetUserDRO (803, NewTool)
SetCurrentTool(NewTool)
code "G0 Z"+Str(zval)      'return to initial position
code "G0 X"+Str(xval)      'before tool change
While IsMoving()
Wend



this is one i copied from a previous thread that works ok but for some reason does not move to t0404 but all other tools! also does not move back a few degrees to lock the atc in position. and also if im on say t0505 and then enter t0101 it tries to move clockwise against the pin. atc can only move counter clockwise for tool position moves. (the emoji is actually an eight)

Sub Main()

NumSlots=8
OldTurretPos=(GetOEMDRO(803))
OldToolSlot=Abs(GetOEMDRO(803)*8)
NextTool = GetSelectedTool()
NextToolSlot = (NextTool-1)*360/NumSlots


If OldToolSlot = NextToolSlot Then
SetCurrentTool(NextTool)
Exit Sub
End If

If NextTool>8 Or NextTool<1 Then
Message("Next Tool out of range")
Exit Sub
End If

MoveDis = (NextToolSlot-OldTurretPos)

 If Abs(MoveDis) >180 Then
   If MoveDis < 0 Then     
     MoveDis = 360 - MoveDis     
   Else     
     MoveDis = MoveDis + 360   
   End If     
 End If
 
ActivateSignal(OUTPUT3)  'Release Turret holding pin
Code "G4 P0.5"
While IsMoving ()       
Wend
Code "G00 G91 a" & MoveDis       
While IsMoving ()       
Wend

DeActivateSignal(OUTPUT3)  'Engage Turret holding pin     

SetCurrentTool(NextTool)
Code "G90"
End Sub


i have verified that the atc moves 1degree when i in put g91 g0 a1...
i am a complete novice to this and any help would be much appreciated
 
« Last Edit: April 15, 2023, 02:26:06 PM by glinner81 »

Offline Graham Waterworth

*
  • *
  •  2,673 2,673
  • Yorkshire Dales, England
    • View Profile
Re: Mach 3 atc on boxford lathe
« Reply #1 on: April 15, 2023, 07:24:09 PM »
The macro that came with the machine looks good, it could be that the turret is sticking and needs oil,  You could also reduce the velocity on the A axis and up the acceleration time to stop any missed steps.

The second macro is not for your machine.
Without engineers the world stops
Re: Mach 3 atc on boxford lathe
« Reply #2 on: April 16, 2023, 02:51:05 AM »
Thanks for reply - atc moves freely. Its maybe something I'm missing in the tool table, I haven't set angles for the different tool positions... my thinking was if mach3 knows where the first tool position is then the macro would be able to drive to correct position for say t0202 etc. Also I'm not sure why it tries to move clockwise sometimes

Offline Graham Waterworth

*
  • *
  •  2,673 2,673
  • Yorkshire Dales, England
    • View Profile
Re: Mach 3 atc on boxford lathe
« Reply #3 on: April 16, 2023, 12:17:37 PM »
You could try this one I did many years ago for Boxford 125/160 lathes.

Rename the file and put it in the correct profile macro folder.
Without engineers the world stops
Re: Mach 3 atc on boxford lathe
« Reply #4 on: April 16, 2023, 01:35:29 PM »
I will give it ago tomorrow hopefully and report back. Thanks a mil
Re: Mach 3 atc on boxford lathe
« Reply #5 on: April 19, 2023, 06:24:47 AM »
My turret just keeps rotating with the new macro
Re: Mach 3 atc on boxford lathe
« Reply #6 on: April 19, 2023, 06:45:32 AM »
What language is the macro written in? Is python or c++ or something else?

Offline TPS

*
  •  2,505 2,505
    • View Profile
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mach 3 atc on boxford lathe
« Reply #8 on: April 19, 2023, 11:32:30 AM »
Hi Graham your script looks very promising. I just can't see why it keeps the atc rotating.. any ideas?

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Mach 3 atc on boxford lathe
« Reply #9 on: April 19, 2023, 12:04:53 PM »
Graham's script has parameter's for the step's per tool

from Graham's script:
Code: [Select]
  steps_per_tool = 900 ' number of steps needed to move 1 tool position (45 deg)
  steps_after_pawl = 100 ' set to amount to clear pawl after move (5 deg)
  steps_to_lock_back_on_pawl = 140 ' number of steps to lock onto pawl (7 deg

and it looks like your machine is set to degrees witch means it needs 45 step's per tool.
so you have to set the parameters right.

Code: [Select]
  steps_per_tool = 45 ' number of steps needed to move 1 tool position (45 deg)
  steps_after_pawl = 5 ' set to amount to clear pawl after move (5 deg)
  steps_to_lock_back_on_pawl = 7 ' number of steps to lock onto pawl (7 deg)

i would expect.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.