Threaded View
-
20-02-2018 #18
So a response from the Centroid Forum, Ill try this tomorrow.
http://centroidcncforum.com/viewtopi...4&p=9586#p9586
Because your turret is uni-directional, you will need to calculate the "rolled over position"
and command a move to that position. Once there, you will need to change the machine position
to reflect the turret position.
You don't nee the M107 for this since the tool number is the axis machine position. M107 is to send the tool number to the PLC
For the example(s) below:
Start cnctch.mac with a header for comments etc..
;------------------------------------------------------------------------------
; Filename: cnctch.mac
; Description: Axis driven tool change macro for lathe
; Notes: Turns/rev must be configured 1 = 1 turret position change
; Turret is on 3rd axis, positions are in machine position.
; Requires: Machine home must be set prior to use.
;
#100 = 12 ;Number turret positions
#101 = 1 ;Distance to move from current location to requested location.
#4120 = requested tool
#20601-#20604 = Counts per unit for axes1-4
parameter 6 = 1 for atc
;------------------------------------------------------------------------------
follow with a block that skips if graphing or searching
IF #50001 ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
If not searching or graphing, check to make sure the turret is not already
at the requested position. If it is, skip the macro
IF [ABS[#4120-#5023] < .002] THEN GOTO 1000
; Notes: Turns/rev must be configured 1 = 1 turret position change
; Turret is on 3rd axis, positions are in machine position.
; Requires: Machine home must be set prior to use.
;
#100 = 12 ;Number turret positions
#101 = 1 ;Requested position
#20601-#20604 = Counts per unit for axes1-4
Example 1
ie.. Max position = 12. Sitting on 8, requested 3 Assuming direction always counts up when moving from tool to tool.
;If current machine position of turret is > requested position:
;subtract current position from max 12 - 8 = 4, then add the requested position 3, then add max position 12:
IF #5023 > #4120 THEN #101 = [[#100 - #5023] +[ #4120 + #100]
;Above to get to 3 from 8, you need to command a move to 19. 7 positions greater than current position.
G53 A19
;You may need a short move to go past this position and then reverse back to lock
;Once at requested position and locked, reset position for DRO display and prevent position windup
;Set current machine position to requested position
M26 /A L[#4120*#20603]
Example2
ie.. Max position = 12. Sitting on 8, requested 11 Assuming direction always counts up when moving from tool to tool.
;If current machine position of turret is < requested position:
;simply command a move to requested position
G53 A#4120
;You may need a short move to go past this position and then reverse back to lock
;Once at requested position and locked, reset position for DRO display and prevent position windup
;Set current machine position to requested position
M26 /A L[#4120*#20603]
N1000 ;Macro finished
Thread Information
Users Browsing this Thread
There are currently 2 users browsing this thread. (0 members and 2 guests)
Similar Threads
-
Centroid Acorn DIY CNC controller
By NB70 in forum Control Hardware & SystemsReplies: 3Last Post: 15-11-2017, 02:14 PM -
Centroid Acorn CNC Controller
By wallyblackburn in forum Gantry/Router Machines & BuildingReplies: 22Last Post: 29-10-2017, 12:28 PM -
Controller Cabinet
By cropwell in forum Workshop & EquipmentReplies: 2Last Post: 19-12-2015, 02:23 PM -
FOR SALE: Controller Box for sale
By lateAtNight in forum Items For SaleReplies: 12Last Post: 04-03-2012, 10:17 AM -
Controller Box
By M250cnc in forum Motor Drivers & ControllersReplies: 1Last Post: 21-11-2010, 01:34 AM
Bookmarks