Lathe ATC Gray code inputs?

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Muzzer
Posts: 728
Joined: Mon Feb 19, 2018 2:52 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D269594F9C-0110180512
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK
Contact:

Lathe ATC Gray code inputs?

Post by Muzzer »

Looking at the schematics and instructions for the Gray code BCD toolchanger (ACORN_rev4, 4 BIT GRAY CODE TURRET LATHE, SINGLE TURRET OUTPUT, STANDARD CONNECTIONS), I see there are 4 inputs used, which would be enough for 16 tools. My lathe turret has 8 ways, so I only need to use 3 of the inputs.

Can I reassign the 4th (unused) input or is it hard wired into the PLC code? Alternatively, can I make use of my ETHER1616 card to handle all of the ATC IO and thus free up the Acorn's base IO for homing, limits, probing etc? The latter are more time critical, requiring faster response compared to the turret operation. It's also quite a challenge to get all the required functionality out of only 4-5 inputs, so some additional IO would definitely make life easier.

One additional output from the turret is from a "turret locked" microswitch, which indicates completion and locking of the toolchange. Is there a way to make use of this, to pause operations until / unless the toolchange is successful?
Spartan117
Posts: 101
Joined: Mon Apr 11, 2022 3:37 pm
Acorn CNC Controller: No
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: Lathe ATC Gray code inputs?

Post by Spartan117 »

Muzzer wrote: Mon May 02, 2022 9:23 am Looking at the schematics and instructions for the Gray code BCD toolchanger (ACORN_rev4, 4 BIT GRAY CODE TURRET LATHE, SINGLE TURRET OUTPUT, STANDARD CONNECTIONS), I see there are 4 inputs used, which would be enough for 16 tools. My lathe turret has 8 ways, so I only need to use 3 of the inputs.
I'd be interested in this, too!

And also if the inputs somehow can be used for multiple features. e.g. Using the HOME-Input for PROBE, too. In theory that should be possible, because the HOME-Inputs should not get triggered in a standard PROBE-Action and vice-versa.
Like: If you are Homing, a triggered HOME-Input equals a HOME-Signal. If you are not homing, a triggered HOME-input equals a PROBE-Signal.

I hope you understand what i mean^^
Allin1Chris
Posts: 132
Joined: Wed Jul 31, 2019 12:53 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes

Re: Lathe ATC Gray code inputs?

Post by Allin1Chris »

You should be able to use Only Bit1-3 in the case you only have 8 tools.

Looking at the Acorn Gray-Code with 1 Motor Output Tool Turret Instructions, it states under the Inputs and Outputs section that ToolTurretPosBit4 is Optional if you only need 3 bits.

The ATC instructions can be found after downloading the Acorn CNC12 v4.6 ATC programs and instructions on this page.
https://centroidcncforum.com/viewtopic.php?f=60&t=3397
When requesting support READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043

Please ALWAYS post a FRESH report. To make a report: https://www.youtube.com/watch?v=Ecvg0VJp1oQ.

(We pride ourselves on providing timely solid technical support but, without good information we may not be able to help and/or reply until such information is posted.)

Centroid PLC Tutorial Videos
Muzzer
Posts: 728
Joined: Mon Feb 19, 2018 2:52 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D269594F9C-0110180512
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK
Contact:

Re: Lathe ATC Gray code inputs?

Post by Muzzer »

Hi Chris. Yes, that's what I was looking at. In the PLC code, I was confused by the comments in the MonitorATCStage:

;==============================================================================
MonitorATCStage
;==============================================================================
;Stage is to Determine what ATC related stages should be enabled and disabled based
;on ATC type, Inputs selected, and ect.
;SV_MACHINE_PARAMETER_830 = ATC Type, 0 = none. 1 = incremental, 2 = incremental w/sync,
; 4 = absolute 3bit, 8 = absolute 4bit, 16 = switched reverse
; 32 = self reversing
;
;ATCType_W 0 = Manual Tool Changer
;ATCType_W 1 = Umbrella/Carousel
;ATCType_W 2 = Counter Turret
;ATCType_W 3 = Graycode 2 Output
;ATCType_W 4 = Graycode 1 Output
;ATCType_W 5 = Time Based Turret
;ATCType_W 6 = Axis Based Turret
;ATCType_W 7 = Rack Based Tool Changer

Perhaps I don't know what I'm looking at but the first section suggests to me that SV_MACHINE_PARAMETER_830 should be set to a value of 4, as I have a 3 bit absolute (Gray scale) ATC. The next 8 lines suggest ATCType_W should be 4 for my system with one motor output. It's also set as variable 9830, so the SV_PARAMETER bit is the part that is confusing me. There's also this bit further up:

;Determine what type of tool changer is installed
IF TRUE THEN ATCType_W = SV_MACHINE_PARAMETER_830

;Get word values of tool parameters
IF TRUE THEN P831Value_W = SV_MACHINE_PARAMETER_831
IF TRUE THEN P832Value_W = SV_MACHINE_PARAMETER_832
IF TRUE THEN P833Value_W = SV_MACHINE_PARAMETER_833
IF TRUE THEN P834Value_W = SV_MACHINE_PARAMETER_834
IF TRUE THEN P835Value_W = SV_MACHINE_PARAMETER_835
IF TRUE THEN P836Value_W = SV_MACHINE_PARAMETER_836
IF TRUE THEN P837Value_W = SV_MACHINE_PARAMETER_837
IF TRUE THEN P838Value_W = SV_MACHINE_PARAMETER_838
IF TRUE THEN P839Value_W = SV_MACHINE_PARAMETER_839
IF TRUE THEN P840Value_W = SV_MACHINE_PARAMETER_840
IF TRUE THEN P841Value_W = SV_MACHINE_PARAMETER_841
IF TRUE THEN P842Value_W = SV_MACHINE_PARAMETER_842
IF TRUE THEN P843Value_W = SV_MACHINE_PARAMETER_843
IF TRUE THEN P844Value_W = SV_MACHINE_PARAMETER_844
IF TRUE THEN P845Value_W = SV_MACHINE_PARAMETER_845
IF TRUE THEN P846Value_W = SV_MACHINE_PARAMETER_846

Can you explain what's with the "SV_MACHINE_PARAMETER_830 = ATC Type" comment?

Many thanks
Allin1Chris
Posts: 132
Joined: Wed Jul 31, 2019 12:53 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes

Re: Lathe ATC Gray code inputs?

Post by Allin1Chris »

;SV_MACHINE_PARAMETER_830 = ATC Type, 0 = none. 1 = incremental, 2 = incremental w/sync,
; 4 = absolute 3bit, 8 = absolute 4bit, 16 = switched reverse
; 32 = self reversing

The Above Section is outdated comment

Below is what each value of Parameter 830 does currently

;ATCType_W 0 = Manual Tool Changer
;ATCType_W 1 = Umbrella/Carousel
;ATCType_W 2 = Counter Turret
;ATCType_W 3 = Graycode 2 Output
;ATCType_W 4 = Graycode 1 Output
;ATCType_W 5 = Time Based Turret
;ATCType_W 6 = Axis Based Turret
;ATCType_W 7 = Rack Based Tool Changer

Parameter 830 simply tells the PLC and supporting macro's what type of ATC you have, and activates the relevant code. Otherwise the stages remain dormant in the PLC. In your case you would want to set parameter 830 to a 3 or a 4 based on if your turret needs 2 outputs or 1 output to rotate.

Parameters 831 to 846 are used to determine the Bits for each tool location. (Bits 1-4). If you never have anything higher than 8 as a tool, the 4th bit can be removed (you dont need to do anything extra, the PLC and macros are already setup to handle the situation when Parameter 830 = 3 or a 4.
When requesting support READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043

Please ALWAYS post a FRESH report. To make a report: https://www.youtube.com/watch?v=Ecvg0VJp1oQ.

(We pride ourselves on providing timely solid technical support but, without good information we may not be able to help and/or reply until such information is posted.)

Centroid PLC Tutorial Videos
Muzzer
Posts: 728
Joined: Mon Feb 19, 2018 2:52 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D269594F9C-0110180512
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK
Contact:

Re: Lathe ATC Gray code inputs?

Post by Muzzer »

Aha. Thanks for confirming that! Having said that, there's still some confusion in parameter 830.

You said:
Parameter 830 simply tells the PLC and supporting macro's what type of ATC you have, and activates the relevant code. Otherwise the stages remain dormant in the PLC. In your case you would want to set parameter 830 to a 3 or a 4 based on if your turret needs 2 outputs or 1 output to rotate.

Parameters 831 to 846 are used to determine the Bits for each tool location. (Bits 1-4). If you never have anything higher than 8 as a tool, the 4th bit can be removed (you dont need to do anything extra, the PLC and macros are already setup to handle the situation when Parameter 830 = 3 or a 4.


The first paragraph (correctly?) tells me that 830 identifies whether the turret requires 1 or 2 outputs (ie forward and reverse presumably). However, the second paragraph seems to suggest (incorrectly?) that 830 indicates either a 3 or 4 bit number for the number of tools. But I assume you are correct in saying that it will not get confused if I supply a 3 bit position Gray code.

I have 8 individual outputs from the rotary switch in my turret, one per tool to indicate the current position, whereas the "Gray code BCD" ATC options expect a 3 or 4 bit word. Looking at the SRC file, I wouldn't want to get involved with the code if I could help it, so I plan to use a diode logic array to convert my 8 bits to a 3 bit Gray code and feed that to my ETHER1616 card. The propagation delays seem to be reasonably small given how the turret works, so I'm thinking that running the turret from the ETHER1616 will have the merit of keeping the mainstream lathe and turret IO at least visually and physically independent, as well as keeping more of the base Acorn IO free.
Allin1Chris
Posts: 132
Joined: Wed Jul 31, 2019 12:53 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes

Re: Lathe ATC Gray code inputs?

Post by Allin1Chris »

Muzzer,

Parameter 830 does not determine the amount of bits used.

Parameter 830 when its either a 3 or 4 (These are not 3 bit or 4 bit, just happens to be the number for a Gray Code 1 Output turret or Gray Code 2 Output turret), lets the PLC know that it will be using gray code and to look at then Parameters 831-846 to determine bits used.

If you wanted to make it work with each tool having its own input, You could likely replace the logic under ATCGrayCodeStage in plc to say something more like this for example.

Code: Select all

IF Tool1Input THEN CurrentTurretPosition_W = 1
IF Tool2Input THEN CurrentTurretPosition_W = 2
ect...
When requesting support READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043

Please ALWAYS post a FRESH report. To make a report: https://www.youtube.com/watch?v=Ecvg0VJp1oQ.

(We pride ourselves on providing timely solid technical support but, without good information we may not be able to help and/or reply until such information is posted.)

Centroid PLC Tutorial Videos
Muzzer
Posts: 728
Joined: Mon Feb 19, 2018 2:52 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D269594F9C-0110180512
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK
Contact:

Re: Lathe ATC Gray code inputs?

Post by Muzzer »

Many thanks, Chris - I'll look into this. Sounds as if it may not be quite as intimidating as I'd thought. I'll report back when I get to that stage of development.
Muzzer
Posts: 728
Joined: Mon Feb 19, 2018 2:52 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D269594F9C-0110180512
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK
Contact:

Re: Lathe ATC Gray code inputs?

Post by Muzzer »

I've finally got round to this part of the activity. Today I updated from 4.64 to 4.80 and installed the centroid_acorn_v480_lathe_universal ATC content. It seems to have worked, judging by the ATC content that appeared in the wizard.

I changed the content around the ATC graycode section as you suggested above, then compiled it without error. I notice that the stage names have been changed between 4.64 and 4.80, along with some of the ATC sections. Here's my new content:

;==============================================================================
ATCGrayCodeStage
;==============================================================================
; EME 2022-08-13 ATC control trials
; Input 1 on Ether1616 with A0 address = CNC12 input 33 etc
; IF Tool1Input THEN CurrentTurretPosition_W = 1?
; IF Tool2Input THEN CurrentTurretPosition_W = 2?
; etc...
IF TRUE THEN CurrentTurretPosition_W = 0
IF INP33 THEN CurrentTurretPosition_W = 1
IF INP34 THEN CurrentTurretPosition_W = 2
IF INP35 THEN CurrentTurretPosition_W = 3
IF INP36 THEN CurrentTurretPosition_W = 4
IF INP37 THEN CurrentTurretPosition_W = 5
IF INP38 THEN CurrentTurretPosition_W = 6
IF INP39 THEN CurrentTurretPosition_W = 7
IF INP40 THEN CurrentTurretPosition_W = 8
IF TRUE THEN SV_PLC_CAROUSEL_POSITION = CurrentTurretPosition_W

IF TRUE THEN SV_PLC_CAROUSEL_POSITION = CurrentTurretPosition_W


I have my 8 position switch wired into the ETHER1616 inputs 1-8 and the (single) output also comes out of the ETHER1616, although I've not connected the hydraulic solenoid at this stage. I have my "turret locked" input set up to ToolIsUnclamped in the wizard - this microswitch indicates that the turret is fully indexed and locked. The position switch correctly toggles the inputs, as seen by the LEDS and the new "Acorn Simplified Input / Output PLC Diagnostics" screen

When I try a T01 or "Turret INDEX" in VCP, I get a TIMEOUT:
304 MDI...
313 Waiting for dwell time
311 Waiting for memory #52 (M101)
327 Fault: job cancelled
9090 ATC_TIMEOUT


The error messages look as if they might be quite informative but I can't see where to look them up. Removing the ToolIsUnclamped connection makes no difference, so it doesn't appear to be watching that input status and waiting for it to change.

Can anyone help? I've attached my current report.
Muzzer
Posts: 728
Joined: Mon Feb 19, 2018 2:52 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D269594F9C-0110180512
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK
Contact:

Re: Lathe ATC Gray code inputs?

Post by Muzzer »

EDIT: I noticed that when I ran the PLC Detective, I got "The file "acorn_lathe_plc.src" does not match what was generated from the original source. To avoid problems, exit and recompile the source file again."

I recompiled and now the error message simply says "ATC_TIMEOUT" when I press Turret INDEX in VCP - and the modified "ATCGrayCodeStage" content is showing correctly in PLC Detective. When I turn the input switch, the variables update correctly in PLC Detective. Seems it was using an old plc file. I'm new to this!

I will digest the source code further, referring to the PLC Detective as I go. Hopefully I am making progress as I learn....
Post Reply