ATC - M101 and M6 Modifications

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

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

ATC - M101 and M6 Modifications

Post by RJS100 »

I just completed a carousel style ATC that I have been designing to be CNC12 compatible with the least amount of custom programming possible. The attached schematic is a modified version of the Centroid supplied schematic for this kind of ATC. The main modification is that I removed the VFDZeroSpeed input.

Uwe mentioned that I can add M101 macro that contains the command /70014 ;Wait for Zero Speed. I understand that this will act as a virtual input and CNC12 will wait for the spindle to stop before moving ahead. I created the M101 macro (see attached).

I have no experience at all writing macros, but I believe that I have to change the M6 macro and add the M101 line most likely after M5 in the M6 macro.

I will be away for the next few weeks and hope to test this ATC for the first time using just after I upgrade from CNC12 v5.10 to CNC v5.40.

Can you please help with this minor macro implementation.

1. What is the correct file extension and file folder for the M101 macro. I believe it is supposed to be "C:\cncm\ncfiles\mfuncs\M6.cnc" but I don't see a mfuncs directory.

2. What is the correct file extension and file folder for the M6 macro? Does the Wizard change the name of the M6 macro if the ATC is being used. How do I modify the M6 macro properly?

Thanks... Richard
Attachments
M101.cnc.txt
(27 Bytes) Downloaded 5 times
15 s15119.r1 ATC ONLY (RJS) VALVE LATCHING RELAY.pdf
(1.77 MiB) Downloaded 8 times


suntravel
Community Expert
Posts: 3825
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 »

M101 is a build in function, M101 – Wait for PLC Bit (Closed, On, Set)

If you want to wait for zero spindle speed in a macro:

Code: Select all

IF #50001                        ;Prevent lookahead from parsing past here
M101 /70014                      ;Wait for Zero Speed
File Name for M6 = mfunc6.mac in the \cncm folder

Uwe


Ken Rychlik
Posts: 586
Joined: Wed Jan 23, 2019 4:19 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: 80F5B5B92C3A-0213236854
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: ATC - M101 and M6 Modifications

Post by Ken Rychlik »

If you have zero speed signal going from your vfd to the acorn and it is working, you can also do
M101/50007 ;Wait for input 7

It can be wait for it to open or wait for it to close with M100 or M101

I use those for waiting on chuck to open or close, verify tool holder in spindle, ect....

Depending on the number of inputs you have, you can also just put a pause in the M5
Ken


suntravel
Community Expert
Posts: 3825
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 »

Since you have a spindle encoder, there is no need for wasting an input and doing extra wiring.

If there is no speed on the spindle the PLC will set Mem Bit 14

Code: Select all

SpindleZeroSpeedState_M         IS MEM14
This can be tested with M101 /70014

The IF #50001 is to prevent further processing til 70014 is set.

Uwe


cncsnw
Community Expert
Posts: 4666
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 »

Custom M functions are in the CNC12 installation directory. On a mill control that is c:\cncm.

If there is a custom M6, it is named "mfunc6.mac".

Yes, it would be appropriate to wait until the spindle is at zero speed, in the M6 macro, after calling M5, and before advancing the carousel.

There is no need for "IF #50001" ahead of "M101/70014".

An M101 command always runs in order, at run-time. That is different from "IF #70014", which would be evaluated at parse time. However, "IF #70014" does not need "IF #50001" ahead of it either, since "IF #70014" will by itself force parsing to wait for execution to catch up.


cncsnw
Community Expert
Posts: 4666
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 »

As far as I can tell, a standard Acorn PLC program sets MEM14 "SpindleZeroSpeedState_M" based only on the "VFDZeroSpeed" input, if any.

I do not see any reference to the spindle encoder or SV_MEASURED_SPINDLE_SPEED.

You could, of course, replace:

Code: Select all

IF VFDZeroSpeed THEN (SpindleZeroSpeedState_M)
with

Code: Select all

IF ABS(SV_MEASURED_SPINDLE_SPEED) < 10 THEN (SpindleZeroSpeedState_M)
But that will only work if you have a spindle encoder, have it properly configured, and have set bit 0 of Parameter 78.


suntravel
Community Expert
Posts: 3825
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 »

ok, so it is like belt and suspenders :mrgreen:

This here is working with no VFD zero Speed input and encoder...

Code: Select all

IF #50001                        ;Prevent lookahead from parsing past here
;IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching

N100                             ;Insert your code between N100 and N1000  

G97                              ;Turn off CSS
G98                              ;Feed per Minute
M5                               ;Turn off Spindle

M101 /70014                      ;Wait for Zero Speed

IF ~#9078 and 1 THEN GOTO 200    ;Skip Spindle Encoder Speed Check if None Used
N110
G4 P0.1
IF #50001
IF #25009 > 10 THEN GOTO 110

N200
M94 /51                          ;Request C-Axis Enable
M51                              ;Perform Default M51 Actions
M151                             ;Unwind C-Axis Position
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 »

Looking at my CNCM directory, I see "mfunc6" which I understand to be the standard M6 macro. I also see Mfunc6 customized for the probeApp as well as Mfunc6 customized for the ProbeApp and an ATC.

Why are there several versions of this file? When I viewed the M6 macro, "M101 /70014 was already included. What is the simplest way to get this working correctly.

Even though I am really waiting to test this with CNC12 v5.40, I did a bench test today. Something doesn't look quite right:

https://www.dropbox.com/scl/fi/ousoe44q ... 7jo9h&dl=0


Richard
Attachments
mfunc6.mac
(10.48 KiB) Downloaded 3 times
M101.cnc.txt
(27 Bytes) Downloaded 3 times
File Directory.jpg


cncsnw
Community Expert
Posts: 4666
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 »

Your video looks pretty reasonable to me.

It advanced the carousel to remove T1 from the spindle; moved Z up; rotated four positions to get to T5; moved Z down; and retracted the carousel.

I could not hear it unclamping and clamping the drawbar, but I assume that is happening at the appointed times.

What is it that does not look right?

Note that after "ATC Init", the control does not assume T1 is in the carousel. It assumes T1 is in the spindle, and that the carousel is rotated to position 1. Therefore the first step in a tool change is to return T1 from the spindle to the carousel.


suntravel
Community Expert
Posts: 3825
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 »

cncsnw wrote: Mon Sep 01, 2025 2:28 pm As far as I can tell, a standard Acorn PLC program sets MEM14 "SpindleZeroSpeedState_M" based only on the "VFDZeroSpeed" input, if any.

I do not see any reference to the spindle encoder or SV_MEASURED_SPINDLE_SPEED.

You could, of course, replace:

Code: Select all

IF VFDZeroSpeed THEN (SpindleZeroSpeedState_M)
with

Code: Select all

IF ABS(SV_MEASURED_SPINDLE_SPEED) < 10 THEN (SpindleZeroSpeedState_M)
But that will only work if you have a spindle encoder, have it properly configured, and have set bit 0 of Parameter 78.
Of course you are right, I forgot the test with #25009 if no input is used for zero speed.

With your PLC change it is working also.

Uwe


Post Reply