ATC - M101 and M6 Modifications

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

cncsnw
Community Expert
Posts: 4664
Joined: Wed Mar 24, 2010 5:48 pm
Acorn CNC Controller: No
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No

Re: ATC - M101 and M6 Modifications

Post by cncsnw »

I have lost track of what you want to change, and why.

Your M6 macro, as you have highlighted above, already waits for the spindle to stop, as reported from the spindle drive through the PLC.

It seems to me that waiting for the spindle to stop prior to advancing the carousel is a good idea, so I assume you are not looking to remove that condition. Are you looking to replace the factory-supplied condition (which is dependent on a working VFDZeroSpeed signal from the spindle drive) with a test that watches the speed of the spindle encoder instead?


RJS100
Posts: 782
Joined: Tue Oct 20, 2020 8:41 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Arizona

Re: ATC - M101 and M6 Modifications

Post by RJS100 »

Great question Marc. When I started the project, I noticed that the stock schematic had a VfdZeroSpeed input. Uwe mentioned that this was not necessary, and I could accomplish the same by adding "M101 /70014". I understand the purpose here is to stop the spindle before advancing the carousel.

So, the quick answer is that I want the simplest way possible, to make sure the spindle is stopped while the ATC is operating.

For what it's worth, I use an AC servo for the spindle motor and have an encoder installed that I use for rigid tapping.

I did a test today with the spindle turning when I issued the T5 M6 command. The spindle continued turning until the moment the carousel moved toward the mill. Once the carousel started moving toward the spindle, it stopped spinning. I

I would rather see the spindle stop as soon as the tool change is requested.

Richard
Last edited by RJS100 on Tue Sep 02, 2025 9:15 pm, edited 2 times in total.


suntravel
Community Expert
Posts: 3824
Joined: Thu Sep 23, 2021 3:49 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 6433DB0446C1-08115074
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany

Re: ATC - M101 and M6 Modifications

Post by suntravel »

RJS100 wrote: Tue Sep 02, 2025 6:36 pm Great question Marc. When I started the project, I noticed that the stock schematic had a VfdZeroSpeed input. Uwe mentioned that this was not necessary, and I could accomplish the same by adding "M101 /70014". I understand the purpose here is to stop the spindle before advancing the carousel.

So, the quick answer is that I want the simplest way possible, to make sure the spindle is stopped while the ATC is operating.

For what it's worth, I use an AC servo for the spindle motor.

Richard
Yeah my fault / misinterpreting. It is only working without an input if you do the small PLC edit as marc suggested.

Uwe


RJS100
Posts: 782
Joined: Tue Oct 20, 2020 8:41 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Arizona

Re: ATC - M101 and M6 Modifications

Post by RJS100 »

Guys, Thanks for checking this out in so much detail. Really appreciated!

I couldn't fully follow exactly what changes need to be made to the M6 macro. Can you show me the specific changes that need to be made.

No rush, I will be away for the next 10 days.

Thanks as always... Richard


cncsnw
Community Expert
Posts: 4664
Joined: Wed Mar 24, 2010 5:48 pm
Acorn CNC Controller: No
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No

Re: ATC - M101 and M6 Modifications

Post by cncsnw »

In the M6 macro, in the block below N600 (for carousel-type tool changers), you could replace "M101/70014" with a loop similar to what Uwe suggested:

Code: Select all

N610
G4 P0.1
IF #50001
IF ABS[#25009] > 10 THEN GOTO 610
This will cause the CNC code to loop continuously, until the measured speed from the spindle encoder is less than 10RPM. Then it will proceed to the next steps.


RJS100
Posts: 782
Joined: Tue Oct 20, 2020 8:41 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Arizona

Re: ATC - M101 and M6 Modifications

Post by RJS100 »

Thanks Marc. That makes perfect sense.

Thanks for all your patience and ideas. Between your suggestions for clamped and unclamped sensors on the power drawbar, the timing cam for the tool counter, and Uwe suggesting machining the Geneva cam from Delrin, this thing runs amazingly smooth and quiet. I can't say thank you enough :D

I am gone for two weeks, once I return, I will add the code to M6 macro and move the tool counter proximity sensor as suggested by Greg (I didn't see that one coming... Just when I thought I was done!).

Then I can mount this thing to the mill.... And cross my fingers :ugeek:

Thanks again for all your help.

All the best.. Richard


Greg
Posts: 44
Joined: Wed Feb 03, 2021 11:12 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory 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 - M101 and M6 Modifications

Post by Greg »

I have no encoder or zero speed output on my vfd so I use one of these from the vfd to a motor wire. its been working great since Nov 2023.
https://www.amazon.com/Current-Sensing- ... C68&sr=8-3

Here is my M6, maybe it can be helpful in some way. Mind that I am still using a old version of cnc12

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

;------------------------------------------------------------------------------
; 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
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

;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


Post Reply