Hello Guest it is April 27, 2024, 09:45:12 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - glinner81

Pages: 1
1
General Mach Discussion / 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
 

Pages: 1