Page 6 of 9

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

Posted: Mon Jun 11, 2018 5:09 pm
by Chaz
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

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

Posted: Wed Jun 13, 2018 12:34 pm
by Centroid_Tech
Our software department is looking into this. In the meantime, it appears that you have found a workaround by adding an M0.

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

Posted: Wed Jun 13, 2018 2:02 pm
by Chaz
Centroid_Tech wrote: Wed Jun 13, 2018 12:34 pm Our software department is looking into this. In the meantime, it appears that you have found a workaround by adding an M0.
Thanks, indeed although it would be good to get it working properly. Is there any code or similar that we can use to emulate it thinking its in MDI mode or something where we can do 2 logic streams? One in MDI mode and 1 not?

For example,

IF IN MDI DO X, ELSE DO Y?

Thanks

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

Posted: Wed Jun 13, 2018 2:51 pm
by Centroid_Tech
Unfortunately, there isn't. The only way around this issue that I can think of is the way that you have already determined using the M0.

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

Posted: Thu Jun 14, 2018 12:36 pm
by martyscncgarage
Chaz & QMC Graham,
How are your latest tool change macros getting along?
I am starting to venture into this territory with an EMCOTURN 140 lathe I am working on.
Ultimately, I am hoping I can make do with the 8 inputs that ACORN has in order to utilize the gray code logic to ensure that the turret has rotated and seated in proper turret pocket.

The language used in the Macro is new to me. I've not had to do this before and am trying to learn and need to learn, but need to understand how it works before I can do anything with it.

It is beneficial for me to start a new thread so others can follow along, because there are many others in similar situations, and hopefully we can all learn. First controlling the turret as an axis. and then adding the logic to the PLC for the "gray logic".

Your basic turret control with driving it as an axis is a good basic starting point.
Currently I have the turret on axis 4.

Here is a brief video of the turret turning as a rotary axis, only to prove that I have the "gearing" correct and the pawl is seating in its pocket

https://youtu.be/1iafff9AVFA

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

Posted: Thu Jun 14, 2018 3:53 pm
by QMC Graham
Hi Marty,
Looking forward to the turret series.
As far as myself and chaz are in relation to the macro, we are all working apart from the resetting of the "distance to go".
Which is only an issue when running a program.
No issue in "mdi"

I'm making programs and running them fine, I've just put the "M0" command in the macro that chaz has published above after the "M26" command.
It just means after every tool change I have to press "cycle start"
Small price to pay at the moment.
But does allow me to actually run programs using more than 2 tools.
(I'm sure you have read this thread which explains why only 2 tools where able to be used)

The thing with my turret and chaz's turret is we have no logic and no switches or switch of any kind.
So we are just using the macro with calculated moves forward and reverse.

When I brought my machine all the gray scale logic components had been removed, so I've got a purely mechanical / macro driven turret.
It works.

Just posted a video of the Emco lathes first Rigid tap, using three tools. Programmed with Intercon,

https://youtu.be/kj5_By6IwIM

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

Posted: Mon Jul 02, 2018 6:23 am
by Chaz
Centroid_Tech wrote: Wed Jun 13, 2018 12:34 pm Our software department is looking into this. In the meantime, it appears that you have found a workaround by adding an M0.
Hi, any update on this from your software team please?

Thanks

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

Posted: Mon Jan 28, 2019 9:13 pm
by osrix25
Hey Chaz and Graham, finally ive made it to this stage! its been a long journey lol :)
I think im using a similar atc to you guys, boxford 125 - no sensors just an axis and pawl to back up onto.
Is this macro complete? I dont understand most of the parameters yet.

Ive yet to learn where to put this yet, its my next job, I just wanted to ask first if this is working as is or if i need to add anything for when I do ?

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

Posted: Tue Jan 29, 2019 3:30 am
by Chaz
osrix25 wrote: Mon Jan 28, 2019 9:13 pm Hey Chaz and Graham, finally ive made it to this stage! its been a long journey lol :)
I think im using a similar atc to you guys, boxford 125 - no sensors just an axis and pawl to back up onto.
Is this macro complete? I dont understand most of the parameters yet.

Ive yet to learn where to put this yet, its my next job, I just wanted to ask first if this is working as is or if i need to add anything for when I do ?
Hi, it does work, but its clunky and you need to be sure to switch your machine off when the turret is in position 8 etc so that the maths works when you need to restart it etc.

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

Posted: Tue Jan 29, 2019 7:51 am
by osrix25
Chaz wrote: Tue Jan 29, 2019 3:30 am
osrix25 wrote: Mon Jan 28, 2019 9:13 pm Hey Chaz and Graham, finally ive made it to this stage! its been a long journey lol :)
I think im using a similar atc to you guys, boxford 125 - no sensors just an axis and pawl to back up onto.
Is this macro complete? I dont understand most of the parameters yet.

Ive yet to learn where to put this yet, its my next job, I just wanted to ask first if this is working as is or if i need to add anything for when I do ?
Hi, it does work, but its clunky and you need to be sure to switch your machine off when the turret is in position 8 etc so that the maths works when you need to restart it etc.
Thanks Chaz and thanks for doing the hard work, clunky or not if it works it works! there is a note in the code that makes me think ive another step other than adding this into the plc, "Turns/rev must be configured 1 = 1 turret position change" . I assume I need another code section to add the 3rd axis too? Maybe i'll read back through the thread and ask questions after eh!