WMPG Macros

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

suntravel
Posts: 1984
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: WMPG Macros

Post by suntravel »

Sure if VCP starts a makro like park that works as makro on the WMPG to.

But can you turn Mist on and while turned on jog with the WMPG?

I did this not done with an makro running.

Uwe
Dbean
Posts: 35
Joined: Mon Oct 14, 2019 12:02 am
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: WMPG Macros

Post by Dbean »

So I’m still unsure as to what I need to do. I’m using a single output to control the solenoids. When the output is turned on it moves the solenoid to open and closes the chuck. When it’s turned off the signal goes to the other solenoid and moves the solenoid closed and opens the chuck.
If I’m not able to use the Macro buttons for Macros then what am I supposed to do with them?
Again I’m not familiar with all this. I’ve read the same material in the Manual that you have copied and pasted. I’ve also read through the basic macro info and wrote various versions of macros from simple to more complex. Nothing seems to work.
What I feel is a simple operation seems to be more complicated than some of the parts I program. I understand the safety concerns with interlocking the spindle so it’s not opened while operating.
What exactly am I supposed to do in the PLC to accomplish this?
I want one button to M10 and another button to M11.
Do I need to hire someone to write a program for this? I was using a USB Xbox remote and remapping the various buttons. I WAS able to do this using a separate program. Why does the “Centroid Remote” not want to work with Centroid?
suntravel
Posts: 1984
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: WMPG Macros

Post by suntravel »

Here is how I solved to turn on/off mist cooling with the WMPG:

https://centroidcncforum.com/viewtopic.php?f=60&t=6324

Related training video:


This realtes the WMPG Macro buttoms tho run the MPGmacros:

;IF MpgMacro1_M THEN SV_SYS_MACRO = 1 (; makes a comment out of this line)
IF MpgMacro2_M THEN SV_SYS_MACRO = 2
IF MpgMacro3_M THEN SV_SYS_MACRO = 3
IF MpgMacro4_M THEN SV_SYS_MACRO = 4


;--Mist coolant on/off
IF (CoolMistKey || KbMistOnOff_M || SkinCoolMist_M || MpgMacro1_M) THEN (CoolantMistPD)

adding || MpgMacro1_M here makes the WMPG makro1 buttom to turn mist cooling on/off

I thing doing this in a similar way to the Chuck section in the PLC will work also:

;------------------------------------Chuck-------------------------------------
; ChuckState_M Designates whether Chuck should be Open or Closed
; ChuckState_M (GRN) = Chuck Opened
; ChuckState_M (RED) = Chuck Closed
IF TRUE THEN ChuckTimer = SV_MACHINE_PARAMETER_992

IF ChuckFootPedal_I && !SpindleEnableOut_M THEN (ChuckFootPedal_PD)
;IF (ChuckFootPedal_PD ^ ChuckState_M) THEN (ChuckState_M)

;Open Chuck
IF SkinOpenChuck_M || (ChuckFootPedal_PD && !ChuckState_M) THEN (OpenChuckPD)
IF ((OpenChuckPD && !OpenChuck) || (M11L && SV_PROGRAM_RUNNING)) && ColletDisabled_M
&& !SpindleEnableOut_M && ChuckOpenCloseComplete_M THEN RST CloseChuck, SET OpenChuck, SET ChuckTimer,
RST ChuckOpenCloseComplete_M

;Close Chuck
IF SkinCloseChuck_M || (ChuckFootPedal_PD && ChuckState_M) THEN (CloseChuckPD)
IF ((CloseChuckPD && !CloseChuck) || (M10L && SV_PROGRAM_RUNNING)) && ColletDisabled_M
&& !SpindleEnableOut_M && ChuckOpenCloseComplete_M THEN SET CloseChuck, RST OpenChuck, SET ChuckTimer,
RST ChuckOpenCloseComplete_M

;Reset if Activated while Open/Closing
;IF (OpenChuckPD && OpenChuck) || (!M11L && SV_PROGRAM_RUNNING)
; THEN RST OpenChuck, SET ChuckState_M
;IF (CloseChuckPD && CloseChuck) || (!M10L && SV_PROGRAM_RUNNING)
; THEN RST CloseChuck, RST ChuckState_M
;IF (OpenChuckPD && OpenChuck) || (CloseChuckPD && CloseChuck)
; THEN RST ChuckTimer

;Reset By Timer or Input
IF OpenChuck && !ChuckOpenCloseComplete_M && (ChuckIsOpen || (ChuckIsOpenIs_M && ChuckTimer))
THEN SET ChuckOpenCloseComplete_M, RST OpenChuck, RST M11L, SET ChuckState_M
IF CloseChuck && !ChuckOpenCloseComplete_M && (ChuckIsClosed || (ChuckIsClosedIs_M && ChuckTimer))
THEN SET ChuckOpenCloseComplete_M, RST CloseChuck, RST M10L, RST ChuckState_M

;OpenFault
IF OpenChuck && !ChuckOpenCloseComplete_M && (ChuckTimer && !ChuckIsOpenIs_M)
THEN FaultMsg_W = CHUCK_TIMEOUT, Set OtherFault_M, RST ChuckTimer, RST OpenChuck, RST M11L

;CloseFault
IF CloseChuck && !ChuckOpenCloseComplete_M && (ChuckTimer && !ChuckIsClosedIs_M)
THEN FaultMsg_W = CHUCK_TIMEOUT, Set OtherFault_M, RST ChuckTimer, RST CloseChuck, RST M10L

;Clear chuck bits
IF OnAtPowerUp_M THEN SET ChuckOpenCloseComplete_M
IF ChuckOpenCloseComplete_M THEN RST ChuckTimer

;IF (!M10L && !M11L && SV_PROGRAM_RUNNING) THEN RST OpenChuck, RST CloseChuck,
; RST ChuckOpenCloseComplete_M,
; RST ChuckTimer


;-----------------------------------End Chuck----------------------------------

Make a copy of the acorn_lathe_plc.src and mpu.plc edit, compile and test.
If you mess it up use the original files to go back.

Uwe
Dbean
Posts: 35
Joined: Mon Oct 14, 2019 12:02 am
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: WMPG Macros

Post by Dbean »

Uwe,
Thanks for trying. I don't want to come off as dismissive. I do appreciate the attempt but this is not a good solution for me.
You want me to edit the PLC file? And then test? I have no idea what I'm doing with this PLC file or it's language.
The logic to open and close the chuck using an output is already built in and I'm simply trying to cycle the function with the WMPG. The button on the WMPG says "Macro1" it doesn't say "Let's spend the better part of 5 nights deep diving into code, you'll need to first learn it and then come up with a way for it to work for you"

"M94 /4 and M94 /6" are already built in.
I can get the PID to cycle but it's intermittent, I have to press the button about 20 times rapidly and it will sometimes work. I know it's communicating cause the little info box is telling me so.
I find this to be absolutely ridiculous to have to edit and build logic into the PLC for something that should be simple. Maybe there is a way to edit the PLC but it won't be me. I have more important things to be doing in the shop. It's really sad how they've tried to re-invent the wheel here. My other CNCs simply use G Code for a macro and I just need to call up the program # or name to run the macro. I've already wasted too much time on this.
suntravel
Posts: 1984
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: WMPG Macros

Post by suntravel »

Ok.

I tested on my lathe to open / close the chuck with the WMPG.

Set Output 7 to CloseChuck and Output 8 to OpenChuck in the Wizard
With the VCP the outputs are activated for 3s, because parameter 992 is set to 3000

Macro for the WMPG

N100
M94 /6
G4 P4
N1000

opens chuck like the VCP

and second macro

N100
M94 /4
G4 P4
N1000

closes the chuck

This way the WMPG is doing the same thing like the Open/'Close buttoms on the VCP
The logic that the output is only active for the time in #992 is build in the PLC

Without G4P4 M94/x is only active for a fraction of a second (till the macro ends)

Uwe
suntravel
Posts: 1984
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: WMPG Macros

Post by suntravel »

Better PLC version:

;IF MpgMacro1_M THEN SV_SYS_MACRO = 1

IF (ChuckFootPedal_I || MpgMacro1_M) && !SpindleEnableOut_M THEN (ChuckFootPedal_PD)

simple change of these two lines makes the WMPG "Macro 1" buttom to act like a foot pedal.

opens and closes the cuck with only one buttom used.

Done in a minute if Notepad++ is set up for Acorn

No need to spend 5 nights on this, I am new to editing PLC also, takes maybe an hour to learn the basics and then suddenly it looks easy just like editing g-code :D

Uwe
Last edited by cncsnw on Fri Jun 17, 2022 5:11 pm, edited 1 time in total.
Reason: added parentheses around OR combination
Dbean
Posts: 35
Joined: Mon Oct 14, 2019 12:02 am
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: WMPG Macros

Post by Dbean »

suntravel wrote: Fri Jun 17, 2022 5:39 am Ok.

I tested on my lathe to open / close the chuck with the WMPG.

Set Output 7 to CloseChuck and Output 8 to OpenChuck in the Wizard
With the VCP the outputs are activated for 3s, because parameter 992 is set to 3000

Macro for the WMPG

N100
M94 /6
G4 P4
N1000

opens chuck like the VCP

and second macro

N100
M94 /4
G4 P4
N1000

closes the chuck

This way the WMPG is doing the same thing like the Open/'Close buttoms on the VCP
The logic that the output is only active for the time in #992 is build in the PLC

Without G4P4 M94/x is only active for a fraction of a second (till the macro ends)

Uwe
Ok, a couple things. I was able to add G4 P1 and now it cycles every time. I did just the P1 cause it already has the 3 seconds built in to #992 so the dwell time is shorter and I'm not waiting on it, but it now works every time. THANK YOU!!!
I knew it had to be something more simple.
I disagree with the other statement. PLC editing is not equal to G Code editing. There are way more statements, system Variables, syntax, order of operation, naming, IF/THEN statements, etc. I can grasp the language but where do I find the terms?
The PLC Manual is 144 pages long and doesn't have an index for all the different functions. If I wanted to know what the Macro1 button on the WMPG was called in PLC (MPGMacro1_M), where do I find this info? Besides having to rely on a forum and generous folks like yourself, I'd be even more lost.
I've tried doing a Find in the PDF and no where does it have the system variable for WMPG in the manual. Nor does it have info pertaining to the timing of these macros. How am I to know that the G94 /4 won't work by itself cause it's so fast and how am I to know the term to use to call it up?
Happy but not happy. Happy it's working like I wish it would have 2 years ago, not happy that I can't write this stuff myself without relying on a community of kind hearted people.
Again thanks for sticking with me. Time to go make some parts!
suntravel
Posts: 1984
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: WMPG Macros

Post by suntravel »

Well my POV is different.

By a lets say Nakamura with fanuc, you get around 3000 or more pages manuals and technical information with it and can do less customizing than with a Acorn DIY CNC...

Acorn is just a very good DIY CNC for a small price tag. Documentation is much better than on other DIY CNCs, but not perfect, because they are improving Acorn very fast and updating documentation ist also time and cost intensive for Centroid. So the PLC manual is for older versions, but the logic is the same like now. It is not more complicate than advanced macro programming in g-code IMHO.

If you want to get full use of a DIY CNC with an open PLC you have to figure out advanced g-code macros and how to manipulate the PLC.

I do this with forum search, Centroids videos and the manuals.

But I am happy that your problem ist solved now :)

Uwe
Dbean
Posts: 35
Joined: Mon Oct 14, 2019 12:02 am
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: WMPG Macros

Post by Dbean »

Danke schön Herr Uwe.
suntravel
Posts: 1984
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: WMPG Macros

Post by suntravel »

Code: Select all

;--M-Codes
;    Reset these M-codes if not in CNC Program Running mode
IF !(SV_PROGRAM_RUNNING || SV_MDI_MODE) || SV_STOP
 THEN RST M3,
          RST M4,
	  RST M6,		   
          RST M8,
          RST M7,
          RST M10M,
	  RST M10L,
	  RST M11L,
	  RST M18,
	  RST M3P,
	  RST M35
Still learning how the PLC works...

This section defines that these M-Codes are reset if the CNC is not in Program Running mode.
For this reason, you can not switch the related outputs with WMPG macros permanently.

Uwe
Post Reply