Enhanced Tool Touch Off Macro (mfunc6.mac)

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

mikes
Posts: 125
Joined: Thu Jan 04, 2018 3:09 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: New Albany, OH

Enhanced Tool Touch Off Macro (mfunc6.mac)

Post by mikes »

I suspect what I'm about to present has already been contributed by another forum member, but I couldn't find anything like it, so I am sharing it here.

I wanted a simple and safe tool touch off workflow that would be compatible with my normally closed (NC) touch-off device. It's an inexpensive mechanical unit from my friend Amazon. I found one of the shared macros (thanks Scott), but it had some extras I didn't think necessary, and one missing part I thought very important. That is, checking to make sure the touch-off device was connected and not accidentally or defectively in a tripped state. Now, you should know, this is my first macro, but I have what one may say is a fairly extensive programing background. However, I'm not sure that help, as the Centroid macro language is a bit of an odd duck. No offence, and I am sure it has lots of history, and engineering thought went into its design, but man it's a throwback to BASIC without all the good things BASIC has :lol: :P ;) . That said, it is what it is, and I'm more interested in making what I want work, then bad mouthing (I know to late).

There are some things to point out about the macro. It makes extensive use of the DEFINE statement. From a programing constructs perspective, there is much lacking in the macro language, but the DEFINE statement is one of the jewels, I don't see it used anywhere near it should, even the macros from Centroid. I don't know about you, but I don't think #4014 is very descriptive, and adding a comment everywhere a parameter is used to explain what #4014 is, just doesn't make sense. Ok, ok, off my soapbox.

Back to what is different about this macro. With a NC tool touch off device, you know if its connected, as you will see a high (set) input when its is connected and not tripped. Testing for this before moving forward with the actual touch-off, I propose is a safer workflow. The macro looks to see if a NC touch-off device has been configured, and if so checks as described. For a NO (normally open) device, no checks are performed. Have a look and use it if you like. I think I will be enhancing it more to use some of the other configuration parameters, like turning off validations, and not subtracting the height of the touch of device. Not sure when these are useful, but the Wizard give the option.

Last but not least, below is a video of the macro in action. Please let me know if you like it, or think I got something wrong. As I said it is my first.

Attachments
mfunc6.mac
(8.34 KiB) Downloaded 15 times
Last edited by mikes on Mon Nov 25, 2024 10:06 pm, edited 1 time in total.


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

Re: Enhanced Tool Touch Off Macro (mfunc6.mac)

Post by cncsnw »

"Video unavailable" / "This video is private"


corbin
Posts: 73
Joined: Fri Nov 08, 2024 2:57 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: 3484E42757Cd-1018248693
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Enhanced Tool Touch Off Macro (mfunc6.mac)

Post by corbin »

I wish I would have known about DEFINES a little earlier..I think that helps clean up the macro programming a lot!


cnckeith
Site Admin
Posts: 8952
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: Enhanced Tool Touch Off Macro (mfunc6.mac)

Post by cnckeith »

Right on, thanks for posting, looking forward to seeing the video.

Centroid Macro's are not the answer to everything. It is an 'easy' way (Stage 1) for most newbies to modify existing or create new custom feature instructions from the simple to moderately complex to suit the application and individual tastes for how they want things to work.

Stage 2: Centroid's PLC Programming Language which is much more than just ladder logic programming and has powerful controls that can be used to manipulate CNC12 functionality in wide variety of ways. Centroid put a lot of the "control" into the PLC program so the user/integrator can tailor CNC12 to the application at hand. https://www.centroidcnc.com/centroid_di ... manual.pdf

Stage 3: Centroid APi. https://centroidcncforum.com/viewforum.php?f=72

All three of these Centroid CNC control tools (macro programming, plc programming language/compiler/detective , and CNC APi calls) are Free.
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


mikes
Posts: 125
Joined: Thu Jan 04, 2018 3:09 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: New Albany, OH

Re: Enhanced Tool Touch Off Macro (mfunc6.mac)

Post by mikes »

Sorry about the video. I'm not much of a YouTuber. I had it all configured, and neglected to click the publish button. Next time I'll verify in an incognito session. Please try now.

Keith,

Thanks for pointing out the additional tools. I will look deeper. I must say I'm impressed with all the effort Centroid has put into the Acorn and its siblings and cousins. It is nice to see how both the hardware and software have grown since the Acon's introduction. I have no regrets in selecting it for my build.

Mike


cnckeith
Site Admin
Posts: 8952
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: Enhanced Tool Touch Off Macro (mfunc6.mac)

Post by cnckeith »

corbin wrote: Mon Nov 25, 2024 7:37 pm I wish I would have known about DEFINES a little earlier..I think that helps clean up the macro programming a lot!
page 231 in the CNC12 Mill Operator Manual. :D

https://www.centroidcnc.com/centroid_di ... manual.pdf

i'll add it to the introduction to macro programming guide as well since this is a nice way to make the macro more human readable.
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


cnckeith
Site Admin
Posts: 8952
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: Enhanced Tool Touch Off Macro (mfunc6.mac)

Post by cnckeith »

mikes wrote: Mon Nov 25, 2024 10:03 pm Sorry about the video. I'm not much of a YouTuber. I had it all configured, and neglected to click the publish button. Next time I'll verify in an incognito session. Please try now.

Keith,

Thanks for pointing out the additional tools. I will look deeper. I must say I'm impressed with all the effort Centroid has put into the Acorn and its siblings and cousins. It is nice to see how both the hardware and software have grown since the Acon's introduction. I have no regrets in selecting it for my build.

Mike

right on thanks for the stoke, we try hard. and thanks for getting the video working. this is great! always love to see what our customers do with the tools we provide. looking forward to more!
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


suntravel
Community Expert
Posts: 3643
Joined: Thu Sep 23, 2021 3:49 pm
Acorn CNC Controller: Yes
Allin1DC 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: Enhanced Tool Touch Off Macro (mfunc6.mac)

Post by suntravel »

cnckeith wrote: Wed Nov 27, 2024 2:43 pm
corbin wrote: Mon Nov 25, 2024 7:37 pm I wish I would have known about DEFINES a little earlier..I think that helps clean up the macro programming a lot!
page 231 in the CNC12 Mill Operator Manual. :D

https://www.centroidcnc.com/centroid_di ... manual.pdf

i'll add it to the introduction to macro programming guide as well since this is a nice way to make the macro more human readable.
Chapter 11.4.4

Page 231 ;)

Uwe


cnckeith
Site Admin
Posts: 8952
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: Enhanced Tool Touch Off Macro (mfunc6.mac)

Post by cnckeith »

thanks for catching the typo! fixed. 231 it is!

You can define your own text aliases using angle brackets (<>). This is a pure text replacement tool (with one
exception – any text found after a semicolon (‘;’) will be ignored as a comment), but can be quite useful.
To define an alias in your G-code program, use the word DEFINE followed by the name of your alias (in angled
brackets) and the text it will be replacing.
For example, consider the following G-code program:
G17 G90 F25
G00 X1 .0 Y1 .0 Z0 .0
G02 X2 .0 Y2 .0 Z0 .0 R -1.0
Using the angle bracket defines, we could write:
; Definitions begin here
DEFINE <XY_PLANE > G17
DEFINE <ABSOLUTE_POSITIONING > G90
DEFINE <FEEDRATE > F
DEFINE <RAPID_POSITIONING > G0
DEFINE <START_POSITION > X1 .0 Y1 .0 Z0 .0
DEFINE <CLOCKWISE_ARC > G02
DEFINE <END_POSITION > X2 .0 Y2 .0 Z0 .0
DEFINE <BIG_ARC_RADIUS > R -1.0
; Actual job begins below
<XY_PLANE > <ABSOLUTE_POSITIONING > <FEEDRATE >25
<RAPID_POSITIONING > <START_POSITION >
<CLOCKWISE_ARC > <END_POSITION > <BIG_ARC_RADIUS >
This can make your G-code programs both more readable and understandable.
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


corbin
Posts: 73
Joined: Fri Nov 08, 2024 2:57 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: 3484E42757Cd-1018248693
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Enhanced Tool Touch Off Macro (mfunc6.mac)

Post by corbin »

Yeah, it was my fault! I had grabbed an old copy of the manual that I first read before I saw this; It might have been from Avid's site.

Corbin


Post Reply