mfunc6 probe a tool with saving in the tool library and validation in spindle

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Filardo
Posts: 253
Joined: Wed Jul 28, 2021 3:54 am
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: Mfunc6 jauger un outil dans un programme

Post by Filardo »

Ken Rychlik wrote: Tue May 13, 2025 10:00 am make believe tool holder works ok. You can have your machine pause with a message for you to manually change the tool, then it will proceed like it did the change automatically and track the tool height of the new tool you put in
Ok donc elle ira faire le palpage sur le tt ensuite


Filardo
Posts: 253
Joined: Wed Jul 28, 2021 3:54 am
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: Mfunc6 jauger un outil dans un programme

Post by Filardo »

I always get a message about missing parameter 511

j'ai a chaque fois message paramètre manquant 511
voici la macro que j'ai joint en piece jointe

DEFINE <PARM_GRAPHING> #4201
DEFINE <PARM_SEARCHING> #4202
DEFINE <PARM_UNITS_OF_MEASURE> #4006
DEFINE <PARM_FAST_PROBING_RATE> #9014
DEFINE <PARM_SLOW_PROBING_RATE> #9015
DEFINE <PARM_TT1_HEIGHT> #9071
DEFINE <PARM_PROB_INPUT> #9044

IF #50001 ; Empêcher l’anticipation

M5 ; Arrêt de la broche
G53 X0 Y0 ; Positionnement au palpeur
G53 Z-2 ; Descente initiale vers le palpeur

M115 /Z P8 F250 ; Descente rapide jusqu'à contact TT1
M116 /Z P2 F50 ; Légère remontée
M115 /Z P8 F50 ; Repalpage lent

IF #50001

#101 = #9071 ; Stocker la longueur mesurée

MSG "Numéro d'outil : #4120, Longueur mesurée : #9071" ; Vérification avant enregistrement
G10 H[#4120] R[#9071] ; Enregistrement de la longueur d’outil

M0 ; Pause pour contrôle manuel

G53 Z0 ; Remonter après mesure

M225 #100 "L’outil a été mesuré et enregistré"

N1000 ; Fin de macro
Attachments
mfunc6.mac
(1.5 KiB) Downloaded 1 time
Capture d'écran 2025-05-13 183137.png


Filardo
Posts: 253
Joined: Wed Jul 28, 2021 3:54 am
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: Mfunc6 jauger un outil dans un programme

Post by Filardo »

Voici mon tt
Attachments
IMG_20250513_052103.jpg


Ken Rychlik
Posts: 570
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: Mfunc6 jauger un outil dans un programme

Post by Ken Rychlik »

I think most of the help here understand english better. If your macro had notes in english, somone may can help easier. It looks like the message is about line 32

When I do a message for a tool change it looks like below. The tool number it wants is always listed at the top of the screen, as it changes the H number first

M200 "#)**Change Bit Then Machine will Measure**\nPress Cycle Start to continue"
Ken


Filardo
Posts: 253
Joined: Wed Jul 28, 2021 3:54 am
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: Mfunc6 jauger un outil dans un programme

Post by Filardo »

Ken Rychlik wrote: Wed May 14, 2025 8:49 am I think most of the help here understand english better. If your macro had notes in english, somone may can help easier. It looks like the message is about line 32

When I do a message for a tool change it looks like below. The tool number it wants is always listed at the top of the screen, as it changes the H number first

M200 "#)**Change Bit Then Machine will Measure**\nPress Cycle Start to continue"
**Subject:** Adjusting `mfunc6.mac` Macro for Tool Library Update After Probe

**Dear CNC12 Support Team,**

Sorry for the previous macro that was in French. Here is the updated request in English.

I am currently using a **Rack Mount ATC** system with CNC12, and the macro `mfunc6.mac` was auto-generated after I removed the previous custom macro and disabled "Custom M6" in the Wizard CNC12. The macro works correctly for **tool changes, probing, and machine movements**, but **the tool length is not being updated in the Tool Offset Library** after each probe.

### **Current Issue:**
- The **macro successfully changes tools and performs automatic probing** with TT-1.
- However, **the measured tool length is not being stored in the library**, meaning each tool needs to be measured manually every time.
- I would like to ensure that CNC12 **automatically updates the tool length in the Tool Offset Library** after every **tool change and probe cycle**.

### **Requested Changes:**
✅ **Modify `mfunc6.mac`** to correctly store tool length after probing.
✅ **Ensure correct parameters in CNC12 Wizard** for automatic tool length recording.
✅ **Confirm best method (`G10` or another command) to update the tool library correctly.**

### **Additional Information:**
- **Attached:** My current macro (`mfunc6.mac`) as a text file and inline in this email.
- **Rack Mount ATC system in use.**
- Everything works **except automatic tool length storage after probe cycle**.

Could you please **review my macro and suggest the correct adjustments** to ensure **the tool length is stored in the Tool Offset Library after each probe**?
I appreciate your help!

Best regards,
[Your Name]

;------------------------------------------------------------------------------
; Filename: mfunc6.mac
; Description: Tool Change Macro
; Notes:
; Requires: CNC12 V5.08
; Revision Date: 29 SEP 2023
; Please see TB300 or the following link for tips on writing custom macros.
; https://www.centroidcnc.com/centroid_di ... amming.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

;==============================================================================
; Rack Mount Tool Change Program Starts
;==============================================================================
#101 = #4003 ;Save Positioning Mode
G90
M5 ;Turn off Spindle
M9 ;Disable Flood/Mist or DustCollector/VacuumHoldDown
M25 ;Move to Z-Home Position (Reference #1 Z)

M101 /70014 ;Ensure Spindle at Zero Speed

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

M100 /70015 ;Confirm AirPressure

;Skip Putaway if No Tool in Spindle
IF #9976 == 0 && #9431 == 0 THEN GOTO 150
IF #9976 == 0 && #9431 == 1 THEN GOTO 250

IF #9431 == 1 THEN GOTO 200 ;Skip to "Fork" Style Sections

;------------------------------------------------------------------------------
; Put Tool Away Section (Hole)
;------------------------------------------------------------------------------
N100 ;Insert your code between N100 and N1000

G65 "C:\cncm\system\rackmountbins\tool#9976position.cnc" A3 ;Move to Old Tool Position
G30 G91 Z0 ;Move Down to Z Clearance Height
G90
G65 "C:\cncm\system\rackmountbins\tool#9976position.cnc" A8 ;Move Z Down to Tool Rack Height
M15
G30 G91 Z0 ;Clear Z from Tool

;------------------------------------------------------------------------------
; Get New Tool Section (Hole)
;------------------------------------------------------------------------------
N150

G30 G91 Z0 ;Clear Z from Tool
G90
G65 "C:\cncm\system\rackmountbins\tool#107position.cnc" A3 ;Move to New Tool Position
M15 ;Unclamp Tool
G65 "C:\cncm\system\rackmountbins\tool#107position.cnc" A8 ;Move Z Down to Tool Rack Height
M16 ;Clamp Tool
G28 G91 Z0 ;Move Z Up to Clear
G90
M95 /1/2/19 ;End Orient Requested

GOTO 300

;------------------------------------------------------------------------------
; Put Tool Away Section (Fork)
;------------------------------------------------------------------------------
N200 ;Insert your code between N100 and N1000

G65 "C:\cncm\system\rackmountbins\tool#9976position.cnc" A5 ;Move to Old Tool Clearance Position
G65 "C:\cncm\system\rackmountbins\tool#9976position.cnc" A4 ;Move Z Down to Infront of Tool Fingers
G65 "C:\cncm\system\rackmountbins\tool#9976position.cnc" A6 ;Engage Fingers
M15
G30 G91 Z0 ;Clear Z from Tool

;------------------------------------------------------------------------------
; Get New Tool Section (Fork)
;------------------------------------------------------------------------------
N250

G30 G91 Z0 ;Clear Z from Tool
G90
G65 "C:\cncm\system\rackmountbins\tool#107position.cnc" A3 ;Move to New Tool Position
M15 ;Unclamp Tool
G65 "C:\cncm\system\rackmountbins\tool#107position.cnc" A4 ;Move Z Down to Tool Rack Height
M16 ;Clamp Tool
G65 "C:\cncm\system\rackmountbins\tool#107position.cnc" A7 ;Disengage Fingers
M95 /1/2/19 ;End Orient Requested

;------------------------------------------------------------------------------
; Set Tool in Spindle
;------------------------------------------------------------------------------
N300
IF #50001
IF #9160 > 0 THEN G10 P976 R#[#4120 +17000] ELSE G10 P976 R#4120
G4 P.2 ;Dwell to ensure PLC Updates Putback Position

G28 G91 Z0 ;Move Z Up to Clear
G90

;Prevent lookahead from reaching end of job and assigning putback before
; location is updated.
IF #50001

IF #9160 > 0 THEN GOTO 900 ;Skip TT Sequence if Tool Library Used.

;------------------------------------------------------------------------------
; Tool Touch Off Sequence
;------------------------------------------------------------------------------
;--Tool Touch Off Check Configuration Block 500
N500 ;Check to make sure a TT1 is correctly configured

G65 "C:\cncm\system\tt_check_configuration.cnc"

;--Tool Touch Off Cycle Block 550
N550
;Move to Tool Touch Off Reference Location or Prompt Operator to Move to Surface Plate
IF #9432 == 0 THEN G30 P3 G91 X0Y0Z0
IF #9432 == 1 THEN M201 "Jog to Surface Plate\nPress Cycle Start to Continue."

M115 /Z P[#33001] F[#33002] ;Move at fast probing rate until TT detected
M116 /Z P-[#33001] F[#33003] ;Retract at slow probing rate until TT clears
M115 /Z P[#33001] F[#33003] ;Move at slow probing rate until TT detected

IF [[#9043 - 1] % 2 == 0] THEN #106 = #9071 ELSE #106 = 0 ;Check parameter 43 for subtract height option
G92 Z[0-[#106]] ;Set Z position to 0 + detector height stored in parameter 71
G4 P1 ;Wait 1 second
M25 ;Move to Z-Home Position (Reference #1 Z)
G90

GOTO 900

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

M100 /70015 ;Confirm AirPressure

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 /80 ;Request Carousel in
M101 /70074 ;Wait for Carousel In
G4 P.5 ;Carousel debounce
M101 /70074 ;Wait for Carousel In
M15 ;Unclamp Tool

;------------------------------------------------------------------------------
; Carousel Tool New Tool Section
;------------------------------------------------------------------------------
N650
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 /80 ;Request Carousel in
M101 /70074 ;Wait for Carousel in
G4 P.5 ;Carousel debounce
M101 /70074 ;Wait for Carousel in

IF !#70012 THEN M15 ;Request Unclamp if not already
G30 G91 Z0 ;Move Z to tool change Position
G90
M16 ;Clamp Tool
M5 ;Turn off spindle and orient request

;------------------------------------------------------------------------------
; Carousel Finish Section
;------------------------------------------------------------------------------
M94 /81 ;Request Carousel Out
M101 /70075 ;Wait for Carousel Out
G4 P.5 ;Carousel debounce
M101 /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
Attachments
Capture d'écran 2025-05-15 052828.png
mfunc6.mac
(10.48 KiB) Not downloaded yet


Ken Rychlik
Posts: 570
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: Mfunc6 jauger un outil dans un programme

Post by Ken Rychlik »

To me it is very complicated. I use a very simple one that works. Changing title to english may also help.

After doing a tool measure, did you move the z to your work coordinate zero and use the "set wcs z0" button?
Ken


Filardo
Posts: 253
Joined: Wed Jul 28, 2021 3:54 am
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: Mfunc6 jauger un outil dans un programme

Post by Filardo »

Ken Rychlik wrote: Thu May 15, 2025 7:53 am To me it is very complicated. I use a very simple one that works. Changing title to english may also help.

After doing a tool measure, did you move the z to your work coordinate zero and use the "set wcs z0" button?

This is not what I want to do.
I want to be able to create programs with Intercom and integrate multiple tools without having to manually probe each tool in the library every time.
I want to insert a new tool into a program, have it automatically probed, and have its length saved in the tool library without affecting my origin during execution.
Normally, this is the standard in CNC with a TT.


ShawnM
Community Expert
Posts: 3043
Joined: Fri May 24, 2019 8:34 am
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: 7804734C6498-0401191832
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Clearwater, FL

Re: Mfunc6 jauger un outil dans un programme

Post by ShawnM »

I'm confused because my CNC router with a 12 tool rack mount ATC stores all the tool offsets in the library and does not need to remeasure any of the 12 tools during a job. I have my z ref = z home position. The only time I have to remeasure a tool is when I change the bit or drill on the collet. CNC12 will auto measure any tool I select and store the offset value for that tool number.

F5, then select the height offset for the tool you want to auto measure then press F3. Follow the prompts on screen. It will move to your fixed tool touch off and auto measure the tool and update the offset on the screen in front of you.

I then simply call the tool from my program and it uses the offset stored in the library.

Do you have the box checked in the wizard to tell it to store the offset?

There's a prewritten macro for tool offset measuring in the system folder called tool_offset_auto_measure.cnc have a look at it.

Am I missing something?


Filardo
Posts: 253
Joined: Wed Jul 28, 2021 3:54 am
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: Mfunc6 jauger un outil dans un programme

Post by Filardo »

ShawnM wrote: Thu May 15, 2025 3:17 pm I'm confused because my CNC router with a 12 tool rack mount ATC stores all the tool offsets in the library and does not need to remeasure any of the 12 tools during a job. I have my z ref = z home position. The only time I have to remeasure a tool is when I change the bit or drill on the collet. CNC12 will auto measure any tool I select and store the offset value for that tool number.

F5, then select the height offset for the tool you want to auto measure then press F3. Follow the prompts on screen. It will move to your fixed tool touch off and auto measure the tool and update the offset on the screen in front of you.

I then simply call the tool from my program and it uses the offset stored in the library.

Do you have the box checked in the wizard to tell it to store the offset?

There's a prewritten macro for tool offset measuring in the system folder called tool_offset_auto_measure.cnc have a look at it.

Am I missing something?
je suis en pince je lui fait croire que j'ai un rack mount pour pouvoir changer l'outil dans la pince et le palper ensuite pour le programme


Filardo
Posts: 253
Joined: Wed Jul 28, 2021 3:54 am
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: Mfunc6 jauger un outil dans un programme

Post by Filardo »

Bon ça avance le palpage est maintenant opérationnel la longueur est bien enregistrée dans la bibliothèque outil sauf que outil en broche et ça longueur H ne sont pas confirmé sur le dro Voici la macro que je dois encore modifié
Nota je posterais l' évolution de cette macro au fur et à mesure que j'avance je rappelle que je n' ai pas d'ATC je suis en pince er25 Direct


;------------------------------------------------------------------------------
; Filename: nfunc6.mac
; Description: Tool Change Macro with Automatic Tool Touch Off
; Notes: Optimized for CNC12 without Rack Mount ATC
; Requires: CNC12 V5.08
;------------------------------------------------------------------------------

IF #50001 ; Prevent lookahead

N500 ; Tool Touch Off Check Configuration
G65 "C:\cncm\system\tt_check_configuration.cnc"

;-- Safe Position for Tool Change --
N600
G53 X0 Y-400 ; **Tool change position**
M0 ; **Pause for manual tool insertion**
M16 ; **Clamp tool after insertion**
G53 Z0 ; **Safety before probing**

;-- Tool Touch Off Cycle --
N550
IF #9432 == 0 THEN G30 P3 G91 X0 Y0 Z0
IF #9432 == 1 THEN M201 "Move tool to touch plate\nPress Cycle Start to proceed."

M115 /Z P[#33001] F[#33002] ; **Fast probe approach**
M116 /Z P-[#33001] F[#33003] ; **Slight retraction**
M115 /Z P[#33001] F[#33003] ; **Precise touch off**

G92 Z[0-[#106]] ; **Adjust height based on detector**
G10 H[#12000] R[#5023] ; **Update tool library**
G43 H[#12000] ; **Apply tool offset compensation**

G4 P1 ; **Pause for confirmation**
M25 ; **Return to Z-Home**
G90
Last edited by Filardo on Fri May 16, 2025 2:28 am, edited 1 time in total.


Post Reply