Denford Triac Carousel ATC

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

cnckeith
Site Admin
Posts: 8893
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: Denford Triac Carousel ATC

Post by cnckeith »

yeah that one!

you can probably do this ATC with just a macro. i'm in the middle of several projects at once :D , so hoping someone else can jump in here and give you some specific guidance.
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: 705
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: Denford Triac Carousel ATC

Post by Chaz »

OK thanks.

I know there is a lot of documentation and effectively a fairly complex eco system for us who are not too familiar with it. Is there a 'cheat sheet' that shows the depedancies on how each system works together? For example, it would be nice to see something like this (perhaps an image) ....

1. PLC.MAP is where we define all inputs / outputs. If you need new ones, put them in here and use this guide (link) on how.
2. ABC Macro is written like this (guide) and it will use the inputs / outputs defined in PLC.MAP
3. Mill.SRC is the main source file where XYZ happens and it will look at the PLC mapping and use the ABC Macros to execute based on certain M Commands which are defined here (guide).

etc


Chaz
Posts: 705
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: Denford Triac Carousel ATC

Post by Chaz »

cnckeith wrote: Wed Jun 19, 2024 5:53 pm yeah that one!

you can probably do this ATC with just a macro. i'm in the middle of several projects at once :D , so hoping someone else can jump in here and give you some specific guidance.
I did do a Macro years ago (on Centroid) for an early Lathe Rachet / Pawl system which then discovered a bug which was since fixed. The 'method' is probably no longer the right way to do it but I did look at that again yesterday. That was entirely Macro based (I think).

Let me see if I can work out how to do the same again for this application and start from scratch.

I know there is a version of Centroid that we can install to test stuff but not sure if there is a version that I can emulate without being at the machine all the time? That said, I've got wifi dongle coming later today, once I get teamviewer / similar installed, that should hopefully allow me to test from my office.


cnckeith
Site Admin
Posts: 8893
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: Denford Triac Carousel ATC

Post by cnckeith »

Chaz wrote: Thu Jun 20, 2024 4:58 am
cnckeith wrote: Wed Jun 19, 2024 5:53 pm yeah that one!

you can probably do this ATC with just a macro. i'm in the middle of several projects at once :D , so hoping someone else can jump in here and give you some specific guidance.
I did do a Macro years ago (on Centroid) for an early Lathe Rachet / Pawl system which then discovered a bug which was since fixed. The 'method' is probably no longer the right way to do it but I did look at that again yesterday. That was entirely Macro based (I think).

Let me see if I can work out how to do the same again for this application and start from scratch.

I know there is a version of Centroid that we can install to test stuff but not sure if there is a version that I can emulate without being at the machine all the time? That said, I've got wifi dongle coming later today, once I get teamviewer / similar installed, that should hopefully allow me to test from my office.
no the PLC is on the main board so you need to be connected to a board
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: 705
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: Denford Triac Carousel ATC

Post by Chaz »

OK. With 2 screens, loads of docs, I'm getting the jist of this. One part where I am stuck is the definition of

;M80_SV IS SV_M94_M95_80 ;Carousel In
;M81_SV IS SV_M94_M95_81 ;Carousel Out

When the M6 Macro runs, it has a part where it says:

M94/80 ;Request Carousel In

Where / how is the 80 defined? How is the carousel in mapping aligned to this? IE, where / how does it know what output to trigger? Outputs are defined up top in the macro but commented out. I've edited mine to match this system, so may not be correct based on the original macro. I've added in Outputs for myself as I find it odd that Inputs are shown, but not Outputs.

;Inputs
;ZeroSpeed is on INP12
;OrientComplete is on INP17
;ToolClamped is on INP21
;ToolUnclamped is on INP22
;CarouselIsIn is on INP34
;CarouselIsOut is on INP35
;
;Outputs
;ATC_CarouselIn is on OUT33
;ATC_CarouselOut is on OUT34
;ATC_CarouselForward is on OUT35
;ATC_CarouselReverse is on OUT36
;UnclampTool is on OUT37

If I look at the .src document, I can see some code that explains Carousel In / Out.

;------------Carousel In/Out Section------------------------
;Carousel In
IF (SpindleIsOriented && M80_SV && M6_SV) || M80_SV THEN RST M81_SV, SET ATC_CarouselIn,
SET CarouselInOutTimer_T, SET MovingCarouselIn_M, RST MovingCarouselOut_M

IF SV_STOP || !SV_PROGRAM_RUNNING || (MovingCarouselIn_M && ATC_CarouselIsIn)
THEN RST ATC_CarouselIn, RST M80_SV

IF ATC_CarouselIsIn THEN (CarouselInState_M)

Is there something here that helps define or is this just a process / set of state checks?

Or ....

Is the mapping automatically taken from what's defined via the Wizard and it knows that for example ATC_CarouselIn is mapped to OUT33 and it will then basically interpret that as:

M94/80 (or in other words) M94/ Activate Output 33?

Thanks


Greg
Posts: 37
Joined: Wed Feb 03, 2021 11:12 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: Denford Triac Carousel ATC

Post by Greg »

While memory bits are the preferred way to do things I also used simple input/output commands to the pre-configured file and it works perfectly fine too. Here is my frankenstein mfunc6, it has performed thousands of tool changes without a problem.

Code: Select all

;------------------------------------------------------------------------------
; Filename: mfunc6.mac
; Description: Tool Change Macro
; Notes:
; Requires: CNC12 V5.04
; Revision Date: 14 JUN 2023
; Please see TB300 or the following link for tips on writing custom macros.
; https://www.centroidcnc.com/centroid_diy/downloads/acorn_documentation/centroid_cnc_macro_programming.pdf
;------------------------------------------------------------------------------
; Parameters:
; #9011 = Probe Input
; #9044 = TT Input
; #9160 = Enhanced ATC Features (Bins)
; #9161 = Maximum Tool Bins
; #9431 = 0 : Hole Style Holder
;         1 : Fork Style Holder
; #9432 = 0 : Fixed TT Position
;         1 : Surface Plate
;         2 : Tool Library
; #9433 = Surface Plate WCS Part 0
; #9830 = ATC Type, 0 = None, 1 = Carousel, 7 = RackMount
;
; System Variables:
; #4003 = Positioning Mode (G90/G91)
; #4120 = Requested Tool
;
; PLC Variables:
; ToolUnclampedState_M IS MEM12 (#70012)
; SpindleOrientedState_M IS MEM13 (#70013)
; SpindleZeroSpeedState_M IS MEM14 (#70014)
; AirPressureLow_M IS MEM15 (#70015)
; ToolChangeComplete_M IS MEM52 (#70052)
; AtPutbackLocation_M IS MEM59 (#70059)
; AtRequestedToolLocation_M IS MEM64 (#70064)
; CarouselInState_M IS MEM74 (#70074)
; CarouselOutState_M IS MEM75 (#70075)
; PutBackPosition_W IS W50 (#96050)
;
; User Variables:
; #101 = Saved Positioning Mode (G90/G91)
; #106 = Tool Touch Height
; #107 = New Tool Request Bin Location
;
; Return Points:
; G28 = Used For ToolCheck Position / M25 Home Positions
; G30 = Used for Z Height Flyover
; G30 P3 = X,Y,Z TT Location
;
; tt_check_configuration.cnc:
; #33001 = Tool Touch Input (Value from P11 or P44)
; #33002 = Fast Probe Rate
; #33003 = Slow Probe Rate
;------------------------------------------------------------------------------
IF #50001                        ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
IF #9006 == 0 THEN GOTO 950      ;Perform Default Macro if ATC not Installed
IF #9830 == 1 THEN GOTO 600      ;Jump to Carousel Section of Macro
IF #4120 == #9976 THEN GOTO 1000 ;Skip macro if requested tool is in spindle

IF #9160 > 0 THEN #107 = #[#4120 + 17000] ELSE #107 = #4120

IF #107 > #9161 THEN GOTO 800    ;Error Tool Change on Invalid Tool

;==============================================================================

;==============================================================================
; Carousel Tool Change Program Starts
;==============================================================================
N600
#101 = #4003                     ;Save Positioning Mode
M109 /1/2                        ;Disable Overrides
M5                               ;Disable Spindle
M9                               ;Disable Coolant
M107                             ;Send PLC Tool Number
G4 P.25

G30 G91 Z0                       ;Move Z to tool change position
G90
M94 /7                           ;Request Tool Change

M101 /70014                      ;Ensure Spindle at Zero Speed

;IF !#70013 THEN M19              ;Orient Spindle
;M101 /70013                      ;Confirm Spindle Oriented

M101 /50037                     ;Drawbar air pressure above 120psi

IF #96050 == 0 THEN GOTO 650     ;Skip putback
;------------------------------------------------------------------------------
; Carousel Tool Putback Section
;------------------------------------------------------------------------------
;M101 /70013                      ;Confirm Spindle Oriented
M101 /70059                      ;Wait for carousel at Putback Position
G4 P.25

;Move Carousel in and Unclamp Tool
M101 /70059                      ;Ensure carousel at Putback Position
M94 /62                          ;Request Carousel in
M100 /70074                      ;Wait for Carousel In
G4 P.5                           ;Carousel debounce
M100 /70074                      ;Wait for Carousel In
G4 P1.5
M101 /50037                      ;Drawbar air pressure above 120psi
M15                              ;Unclamp Tool
;M101 / 50044                     ;Check if drawbar is unclamped
;------------------------------------------------------------------------------
; Carousel Tool New Tool Section
;------------------------------------------------------------------------------
N650
M101 /50037                      ;Drawbar air pressure above 120psi
G4 P1
G53 Z0                           ;Raise head to Clearance
M94 /40                          ;Set PutBackComplete
M101 /70064                      ;Wait for carousel at Requested Tool Position
M95 /40                          

;IF !#70012 THEN M101 /70013      ;Confirm Spindle Oriented if not Unclamped

M94 /62                          ;Request Carousel in
M100 /70074                      ;Wait for Carousel in
G4 P.5                           ;Carousel debounce
M100 /70074                      ;Wait for Carousel in

IF !#70012 THEN M15              ;Request Unclamp if not already
M101 /50044                      ;Check if drawbar is unclamped
M94 /61                          ;Airblast on
M101 /50037                      ;Drawbar air pressure above 120psi
G30 G91 Z0 L30                   ;Move Z to tool change Position
G90
M95 /61                          ;Airblast off
M16                              ;Clamp Tool
M100 /50044                             ;Check if drawbar is clamped
;M5                               ;Turn off spindle and orient request

;------------------------------------------------------------------------------
; Carousel Finish Section
;------------------------------------------------------------------------------
M95 /62                          ;Request Carousel Out
M100 /70075                      ;Wait for Carousel Out
G4 P.5                           ;Carousel debounce
M100 /70075                      ;Wait for Carousel Out
M101 /70052                      ;Wait for Tool Change Complete
M95 /7                           ;Reset Tool Change Request

M108 /1/2                        ;Enable Overrides

GOTO 900

N800 ;Errors
M225 #100 "Invalid Tool Requested\nCycle Cancel to Abort"
GOTO 800

N900 ;Restore Modes
G#101 ;Restore Positioning Mode

GOTO 1000

N950
M6

N1000                            ;End of Macro


Chaz
Posts: 705
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: Denford Triac Carousel ATC

Post by Chaz »

Greg wrote: Thu Jun 20, 2024 2:19 pm While memory bits are the preferred way to do things I also used simple input/output commands to the pre-configured file and it works perfectly fine too. Here is my frankenstein mfunc6, it has performed thousands of tool changes without a problem.

Code: Select all

;------------------------------------------------------------------------------
; Filename: mfunc6.mac
; Description: Tool Change Macro
; Notes:
; Requires: CNC12 V5.04
; Revision Date: 14 JUN 2023
; Please see TB300 or the following link for tips on writing custom macros.
; https://www.centroidcnc.com/centroid_diy/downloads/acorn_documentation/centroid_cnc_macro_programming.pdf
;------------------------------------------------------------------------------
; Parameters:
; #9011 = Probe Input
; #9044 = TT Input
; #9160 = Enhanced ATC Features (Bins)
; #9161 = Maximum Tool Bins
; #9431 = 0 : Hole Style Holder
;         1 : Fork Style Holder
; #9432 = 0 : Fixed TT Position
;         1 : Surface Plate
;         2 : Tool Library
; #9433 = Surface Plate WCS Part 0
; #9830 = ATC Type, 0 = None, 1 = Carousel, 7 = RackMount
;
; System Variables:
; #4003 = Positioning Mode (G90/G91)
; #4120 = Requested Tool
;
; PLC Variables:
; ToolUnclampedState_M IS MEM12 (#70012)
; SpindleOrientedState_M IS MEM13 (#70013)
; SpindleZeroSpeedState_M IS MEM14 (#70014)
; AirPressureLow_M IS MEM15 (#70015)
; ToolChangeComplete_M IS MEM52 (#70052)
; AtPutbackLocation_M IS MEM59 (#70059)
; AtRequestedToolLocation_M IS MEM64 (#70064)
; CarouselInState_M IS MEM74 (#70074)
; CarouselOutState_M IS MEM75 (#70075)
; PutBackPosition_W IS W50 (#96050)
;
; User Variables:
; #101 = Saved Positioning Mode (G90/G91)
; #106 = Tool Touch Height
; #107 = New Tool Request Bin Location
;
; Return Points:
; G28 = Used For ToolCheck Position / M25 Home Positions
; G30 = Used for Z Height Flyover
; G30 P3 = X,Y,Z TT Location
;
; tt_check_configuration.cnc:
; #33001 = Tool Touch Input (Value from P11 or P44)
; #33002 = Fast Probe Rate
; #33003 = Slow Probe Rate
;------------------------------------------------------------------------------
IF #50001                        ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
IF #9006 == 0 THEN GOTO 950      ;Perform Default Macro if ATC not Installed
IF #9830 == 1 THEN GOTO 600      ;Jump to Carousel Section of Macro
IF #4120 == #9976 THEN GOTO 1000 ;Skip macro if requested tool is in spindle

IF #9160 > 0 THEN #107 = #[#4120 + 17000] ELSE #107 = #4120

IF #107 > #9161 THEN GOTO 800    ;Error Tool Change on Invalid Tool

;==============================================================================

;==============================================================================
; Carousel Tool Change Program Starts
;==============================================================================
N600
#101 = #4003                     ;Save Positioning Mode
M109 /1/2                        ;Disable Overrides
M5                               ;Disable Spindle
M9                               ;Disable Coolant
M107                             ;Send PLC Tool Number
G4 P.25

G30 G91 Z0                       ;Move Z to tool change position
G90
M94 /7                           ;Request Tool Change

M101 /70014                      ;Ensure Spindle at Zero Speed

;IF !#70013 THEN M19              ;Orient Spindle
;M101 /70013                      ;Confirm Spindle Oriented

M101 /50037                     ;Drawbar air pressure above 120psi

IF #96050 == 0 THEN GOTO 650     ;Skip putback
;------------------------------------------------------------------------------
; Carousel Tool Putback Section
;------------------------------------------------------------------------------
;M101 /70013                      ;Confirm Spindle Oriented
M101 /70059                      ;Wait for carousel at Putback Position
G4 P.25

;Move Carousel in and Unclamp Tool
M101 /70059                      ;Ensure carousel at Putback Position
M94 /62                          ;Request Carousel in
M100 /70074                      ;Wait for Carousel In
G4 P.5                           ;Carousel debounce
M100 /70074                      ;Wait for Carousel In
G4 P1.5
M101 /50037                      ;Drawbar air pressure above 120psi
M15                              ;Unclamp Tool
;M101 / 50044                     ;Check if drawbar is unclamped
;------------------------------------------------------------------------------
; Carousel Tool New Tool Section
;------------------------------------------------------------------------------
N650
M101 /50037                      ;Drawbar air pressure above 120psi
G4 P1
G53 Z0                           ;Raise head to Clearance
M94 /40                          ;Set PutBackComplete
M101 /70064                      ;Wait for carousel at Requested Tool Position
M95 /40                          

;IF !#70012 THEN M101 /70013      ;Confirm Spindle Oriented if not Unclamped

M94 /62                          ;Request Carousel in
M100 /70074                      ;Wait for Carousel in
G4 P.5                           ;Carousel debounce
M100 /70074                      ;Wait for Carousel in

IF !#70012 THEN M15              ;Request Unclamp if not already
M101 /50044                      ;Check if drawbar is unclamped
M94 /61                          ;Airblast on
M101 /50037                      ;Drawbar air pressure above 120psi
G30 G91 Z0 L30                   ;Move Z to tool change Position
G90
M95 /61                          ;Airblast off
M16                              ;Clamp Tool
M100 /50044                             ;Check if drawbar is clamped
;M5                               ;Turn off spindle and orient request

;------------------------------------------------------------------------------
; Carousel Finish Section
;------------------------------------------------------------------------------
M95 /62                          ;Request Carousel Out
M100 /70075                      ;Wait for Carousel Out
G4 P.5                           ;Carousel debounce
M100 /70075                      ;Wait for Carousel Out
M101 /70052                      ;Wait for Tool Change Complete
M95 /7                           ;Reset Tool Change Request

M108 /1/2                        ;Enable Overrides

GOTO 900

N800 ;Errors
M225 #100 "Invalid Tool Requested\nCycle Cancel to Abort"
GOTO 800

N900 ;Restore Modes
G#101 ;Restore Positioning Mode

GOTO 1000

N950
M6

N1000                            ;End of Macro
Thanks, will take a look, much appreciated.


Chaz
Posts: 705
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: Denford Triac Carousel ATC

Post by Chaz »

If I type M63 in MDI, then Output 3 on the Ether1616 should activate, correct? If it does nothing, what should I be looking at to fault find?


cncsnw
Community Expert
Posts: 4541
Joined: Wed Mar 24, 2010 5:48 pm

Re: Denford Triac Carousel ATC

Post by cncsnw »

No, the default Acorn M63 turns on whatever output (if any) you have assigned the name "OUTPUT3" through the Acorn Wizard.


Greg
Posts: 37
Joined: Wed Feb 03, 2021 11:12 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: Denford Triac Carousel ATC

Post by Greg »

You can press alt-i to look at and toggle all your outputs for testing, no need for mdi commands.


Post Reply