ATC Macro / PLC Help please <success!>

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

luchito1973
Posts: 14
Joined: Tue Feb 12, 2019 2:37 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please <success!>

Post by luchito1973 »

With mach3 it is very easy to do it. with acorn I do not know how to do it, no I found a centroid macro reference.


DannyB
Posts: 109
Joined: Mon Jan 15, 2018 1:11 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: Yes
CNC Control System Serial Number: A900712
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please <success!>

Post by DannyB »

Have you seen the PLC, Macro, and Skinning guide?
http://www.centroidcnc.com/centroid_diy ... manual.pdf


zigzagwanderer
Posts: 22
Joined: Sun Aug 11, 2019 2:46 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: A81087B9C645-0703192228
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK

Re: ATC Macro / PLC Help please <success!>

Post by zigzagwanderer »

Chaz wrote: Mon Jun 11, 2018 5:09 pm
Centroid_Tech wrote: Mon Jun 11, 2018 10:11 am Please post a current report from your system. You should not need to "unwind" a turret axis. Performing a tool change in MDI should be exactly the same as when running it from a program. Please also provide a copy of the program that you are running.
And here is the code we are using. Running this via MDI always 'resets' the distance to go to 0 for the A Axis. Running it in a program, does not, so the calcs do not remain consistent. M0 in the code, or in the macro, solves the issue but the machine will wait for cycle start on tool change.


;------------------------------------------------------------------------------
; 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 = 8 ;Number turret positions
;#101 = ;Calculated position to move to when requested position < current position.
;#4120 = requested tool
;#20601-#20604 = Counts per unit for axes1-4
;#5021-#5024 is the current machine position for axes 1(#5021) through 4(#5024)
;------------------------------------------------------------------------------

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.
;
;#101 = ;Calculated position to move to when requested position < current position
;#20601-#20604 = Counts per unit for axes1-4
;#5021-#5024 is the current machine position for axes 1(#5021) through 4(#5024)
;#4120 = requested turret position from g code

IF #5023 > #4120 THEN #101 = [8 + #4120] ELSE #101 = #4120

G53 A[#101 + 0.5]
G53 A[#101 - 0.5]

M26 /A L[#4120*#20603]

N1000 ;Macro finished

Hi
Can anyone tell me if a solution to the "distance to go" issue as described in this thread and above has been found, other than to add an M0 in the code ?
I'm trying to get a home built ATC working with this macro and found this thread after hitting the exact same problem , everything works fine with tool commands from the MDI but when i run intercon generated code with multiple tools it falls over.


Chaz
Posts: 704
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please <success!>

Post by Chaz »

zigzagwanderer wrote: Sun Aug 25, 2019 8:13 pm
Chaz wrote: Mon Jun 11, 2018 5:09 pm
Centroid_Tech wrote: Mon Jun 11, 2018 10:11 am Please post a current report from your system. You should not need to "unwind" a turret axis. Performing a tool change in MDI should be exactly the same as when running it from a program. Please also provide a copy of the program that you are running.
And here is the code we are using. Running this via MDI always 'resets' the distance to go to 0 for the A Axis. Running it in a program, does not, so the calcs do not remain consistent. M0 in the code, or in the macro, solves the issue but the machine will wait for cycle start on tool change.


;------------------------------------------------------------------------------
; 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 = 8 ;Number turret positions
;#101 = ;Calculated position to move to when requested position < current position.
;#4120 = requested tool
;#20601-#20604 = Counts per unit for axes1-4
;#5021-#5024 is the current machine position for axes 1(#5021) through 4(#5024)
;------------------------------------------------------------------------------

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.
;
;#101 = ;Calculated position to move to when requested position < current position
;#20601-#20604 = Counts per unit for axes1-4
;#5021-#5024 is the current machine position for axes 1(#5021) through 4(#5024)
;#4120 = requested turret position from g code

IF #5023 > #4120 THEN #101 = [8 + #4120] ELSE #101 = #4120

G53 A[#101 + 0.5]
G53 A[#101 - 0.5]

M26 /A L[#4120*#20603]

N1000 ;Macro finished

Hi
Can anyone tell me if a solution to the "distance to go" issue as described in this thread and above has been found, other than to add an M0 in the code ?
I'm trying to get a home built ATC working with this macro and found this thread after hitting the exact same problem , everything works fine with tool commands from the MDI but when i run intercon generated code with multiple tools it falls over.
Sorry, cant help - I no longer run an ATC on my lathe - but would be interested to know too.


zigzagwanderer
Posts: 22
Joined: Sun Aug 11, 2019 2:46 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: A81087B9C645-0703192228
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK

Re: ATC Macro / PLC Help please <success!>

Post by zigzagwanderer »

Sorry, cant help - I no longer run an ATC on my lathe - but would be interested to know too.
[/quote]

Hi
No problem and thanks for your reply.
With a little head scratching I modified the macro to better suit my application and so far it now works.


Chaz
Posts: 704
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please <success!>

Post by Chaz »

zigzagwanderer wrote: Wed Aug 28, 2019 8:43 am Sorry, cant help - I no longer run an ATC on my lathe - but would be interested to know too.
Hi
No problem and thanks for your reply.
With a little head scratching I modified the macro to better suit my application and so far it now works.
[/quote]

Can you please post the updated code? I have a friend (guy who makes these turrets) looking to implement one on his lathe.

thanks


cnckeith
Site Admin
Posts: 8884
Joined: Wed Mar 03, 2010 4:23 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Contact:

Re: ATC Macro / PLC Help please <success!>

Post by cnckeith »

fyi... Introduction to Centroid Macro's guide is here...
https://www.centroidcnc.com/centroid_di ... amming.pdf
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html


Chaz
Posts: 704
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please <success!>

Post by Chaz »

cnckeith wrote: Fri Dec 27, 2019 1:32 pm fyi... Introduction to Centroid Macro's guide is here...
https://www.centroidcnc.com/centroid_di ... amming.pdf
Nope, checking, thanks.


zigzagwanderer
Posts: 22
Joined: Sun Aug 11, 2019 2:46 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: A81087B9C645-0703192228
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK

Re: ATC Macro / PLC Help please <success!>

Post by zigzagwanderer »

Chaz wrote: Fri Dec 27, 2019 1:21 pm
zigzagwanderer wrote: Wed Aug 28, 2019 8:43 am Sorry, cant help - I no longer run an ATC on my lathe - but would be interested to know too.
Hi
No problem and thanks for your reply.
With a little head scratching I modified the macro to better suit my application and so far it now works.
Can you please post the updated code? I have a friend (guy who makes these turrets) looking to implement one on his lathe.

thanks
[/quote]

I'm not sure how helpful it will be if your using a ratchet and pawl type ATC as mine is unidirectional and uses a hirth style coupling but have a look at this thread , as you will read i'm pretty green to all this but if i can supply any other info let me know

viewtopic.php?f=60&t=3616


Chaz
Posts: 704
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please <success!>

Post by Chaz »

All good thanks, just wanted to see how you solved it. Dont need the code as such and its helpful to others.


Post Reply