M50 function question for PLC use

All things related to Centroid Oak, Allin1DC, MPU11 and Legacy products

Moderator: cnckeith

Post Reply
rjtechserv
Posts: 68
Joined: Sun Nov 18, 2018 7:22 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: CNC12-m39-104028
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: No
Location: Western NY

M50 function question for PLC use

Post by rjtechserv »

I've created an M50 function to rotate a large Caxis Table. It is confirmed to rotate and pre-queued using two hand trip buttons. Once the M50 initiates the cycle I'd like to clear the Memory bit for the pre-queue LED #1057.

I've tried the PLC logic using M50 but something isn't right... watching the M50 doesn't seem to work.

See my attachment for the NC program on top and the PLC on the bottom. Can I clear this memory bit after the M50 is started?

Thanks,

RobJ
Attachments
M50memoryRST.png
Rob Jackson

RJ Technical Services
cncsnw
Posts: 3854
Joined: Wed Mar 24, 2010 5:48 pm

Re: M50 function question for PLC use

Post by cncsnw »

I could not hazard a guess without seeing the whole PLC program and the whole M50 macro (e.g. as would be contained in a Report).

Assuming that your M50 macro does send an M94 request to the PLC program, and that the PLC program does name that request bit "M50", and assuming there is no other logic in the PLC program that manipulates GoReady_M, then yes: I would expect GoReady_M to be turned off as soon as the M50 code runs.

Using the Spindle Speed Plus button as a ready indicator seems a little odd, but I assume you have your reasons....
rjtechserv
Posts: 68
Joined: Sun Nov 18, 2018 7:22 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: CNC12-m39-104028
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: No
Location: Western NY

Re: M50 function question for PLC use

Post by rjtechserv »

Thanks for looking. I've attached my PLC report and do realize up front the PLC is a bit cluttered at the moment as I try to get my barring to what we keep "stock" from Centroid and what we customize. So yes I'm working to repurpose the whole Jog panel for our specific use. We are trying this Hickory system out to learn if this CNC polishing system is practical or not for a Centroid system. I do think it is but, I'm still learning the PLC and Jog panel techniques.

In the PLC I've done nothing with M94 for the M50; I've only assigned the M50 directly to the macro system variable. Could be my flaw. Still learning.

So the M50 rotates a 5 fixture Caxis table. An operator can pre-stage the turntable to take off automatically using the 2hand "GoButtons". If the operator cancels the request or the light curtain is broke we want to cancel this pre-stage. Breaking the light curtain stops the Caxis rotation for safety using the feed hold.

So once the table has started its rotation "M50" we want to RST the pre-stage function to force the operator to hit the two hand trips again confirming rotation is safe and requested. The C-axis is heavily gear reduced so safety is #1 importance!

Rob
Attachments
mfunc50.mac
(2.05 KiB) Downloaded 52 times
report_0008DC111213-0519210024_2021-12-21_08-40-24.zip
(382.56 KiB) Downloaded 52 times
Rob Jackson

RJ Technical Services
cncsnw
Posts: 3854
Joined: Wed Mar 24, 2010 5:48 pm

Re: M50 function question for PLC use

Post by cncsnw »

The PLC program is not automatically informed that the CNC processor happens to be running codes from a file named "mfunc50.mac".

The only way that execution of mfunc50.mac can be related to the "SV_M94_M95_50" bit in the PLC program, which you have sensibly named "M50", is if the CNC macro executes "M94/50" to set it, and/or "M95/50" to clear it.

You should add "M94/50" at the point in your macro where you want the PLC to get the message than an M50 is running; and you should add "M95/50" at the point where that condition no longer applies or is no longer needed.

Be aware that CNC program execution might end (e.g. via Error, Fault, Emergency Stop or Cycle Cancel) after the M94 and before the M95. That would leave the M50 flag set, which might have undesired consequences when the operator starts the next cycle. That is why this sort of feature nearly always has PLC logic similar to:

Code: Select all

IF !SV_PROGRAM_RUNNING THEN RST M50,
                            RST M51
That will ensure that the state flags get turned off whenever the program cycle ends.

Note also that the association between "M50" in the CNC programming -- which calls mfunc50.mac as a subprogram -- and "M50" in the PLC program -- which is another name for the request bit M94_M95_50 -- is purely coincidental or conventional. It is good practice to make them match, but you should be aware that they do not have to match.

If you have a second M function whose only purpose is to turn off the first one, it will generally not have a separate request bit. For example, consider the standard M3, M4 and M5 actions for spindle control:
M3 turns on SV_M94_M95_1 and turns off SV_M94_M95_2 (run forward, and do not run reverse)
M4 turns on SV_M94_M95_2 and turns off SV_M94_M95_1 (run reverse, and do not run forward)
M5 turns off SV_M94_M95_1 and SV_M94_M95_2 (do not run forward or reverse)
The PLC program, then, names SV_M94_M95_1 "M3", and names SV_M94_M95_2 "M4".
There is no need for a request bit named M5, because that is just the absence of M3 or M4.

But I digress....
rjtechserv
Posts: 68
Joined: Sun Nov 18, 2018 7:22 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: CNC12-m39-104028
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: No
Location: Western NY

Re: M50 function question for PLC use

Post by rjtechserv »

That was a great explanation and it makes sense. I'll use those switches in the macro program and RST those as a failsafe as you suggested.

Thanks so much and Merry Christmas!!!

RobJ
Rob Jackson

RJ Technical Services
rjtechserv
Posts: 68
Joined: Sun Nov 18, 2018 7:22 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: CNC12-m39-104028
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: No
Location: Western NY

Re: M50 function question for PLC use

Post by rjtechserv »

Worked perfectly - Great explanation...
Rob Jackson

RJ Technical Services
Post Reply