Spindle Fan M Code

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

fusion
Posts: 42
Joined: Wed May 09, 2018 7:54 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 0479B7ADF2F3-1127192707
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Greensboro, NC

Re: Spindle Fan M Code

Post by fusion »

slodat wrote: Thu Apr 16, 2020 10:16 pm I posted a link to the one I used above.
Hi slodat. I was confused by "I use an interposing relay triggered from SPINFWD and SPINREV. "
So, the relay you linked to above works like this? It keeps the fan on the entire time the output is high, and then keeps the fan on for a period of time after the output goes low? I just wanted to be sure. I already bought a delay off relay from Amazon that didn't work like that.

Thanks!
Mike
fusion
Posts: 42
Joined: Wed May 09, 2018 7:54 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 0479B7ADF2F3-1127192707
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Greensboro, NC

Re: Spindle Fan M Code

Post by fusion »

cncsnw wrote: Thu Apr 16, 2020 11:09 pm Remove the old "SpindleCooling" block from somewhere around line 4100.

Add the following timer definition and code:

Code: Select all

SpindleStopped_T IS T33
; ...
IF SpindleEnableOut_O THEN SET SpindleCooling, RST SpindleStopped_T
IF !SpindleEnableOut_O THEN SpindleStopped_T = SV_MACHINE_PARAMETER_175 * 1000, SET SpindleStopped_T
IF SpindleStopped_T THEN RST SpindleCooling
Set the spindle off-delay time, in seconds, in Parameter 175.
Cncsnw, This seems above my capabilities. I would need a lot more explanation to understand what's going on here. Does it keep the spindle running for the off-delay time? I was trying to keep just the fan going for a period of time. If the above code just keeps the fan on, how does it trigger a specific output? In my case, the fan it connected to output 7. I would think there needs to be some kind of code to link SpindleCooling to an output.

Thanks!
Mike
BASE
Posts: 52
Joined: Fri Oct 04, 2019 7:54 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
CNC Control System Serial Number: A900810
DC3IOB: No
CNC12: No
CNC11: No
CPU10 or CPU7: No

Re: Spindle Fan M Code

Post by BASE »

That's pretty close to what I did in my PLC. I've got a fan/pump/radiator combo running on the spindle cooling output. The timer is just set to the parameter where you input the delay (SV_MACHINE_PARAMETER_175). Once "set" it begins counting and will be evaluated True when it gets there. You assign the output # you need near the top of the PLC code.

One question I have is what prevents the IF !SpindleEnableOut_O from evaluating True after it's started, but before the timer has finished, and perpetually resetting the timer? I used another memory bit that's set when the timer is running. Maybe that was an unnecessary complication?
cncsnw
Posts: 3855
Joined: Wed Mar 24, 2010 5:48 pm

Re: Spindle Fan M Code

Post by cncsnw »

BASE wrote:One question I have is what prevents the IF !SpindleEnableOut_O from evaluating True after it's started, but before the timer has finished, and perpetually resetting the timer? I used another memory bit that's set when the timer is running. Maybe that was an unnecessary complication?
The line

Code: Select all

IF !SpindleEnableOut_O THEN SpindleStopped_T = SV_MACHINE_PARAMETER_175 * 1000, SET SpindleStopped_T
does "run" every scan while the spindle is off.

However, assigning to the timer preset value, and setting the active bit, does not "reset" the timer. If the timer is already active and running, it will just continue to run (little different than SETting an output or memory bit that is already on).

The only condition that resets the timer, so that it starts over at zero next time it gets set, is if SpindleEnableOut_T is true (i.e. the spindle starts running again).

Fusion: if you used the Wizard to assign "SpindleCooling" to OUT7, then your PLC program source should already have a line in it that says

Code: Select all

SpindleCooling IS OUT7
In the example I posted, I only included code that would have to be new or changed.
BASE
Posts: 52
Joined: Fri Oct 04, 2019 7:54 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
CNC Control System Serial Number: A900810
DC3IOB: No
CNC12: No
CNC11: No
CPU10 or CPU7: No

Re: Spindle Fan M Code

Post by BASE »

Thank you for the explanation. For some reason I assumed that SET of the timer would restart it. Off to delete some lines of code....
fusion
Posts: 42
Joined: Wed May 09, 2018 7:54 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 0479B7ADF2F3-1127192707
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Greensboro, NC

Re: Spindle Fan M Code

Post by fusion »

Cncsnw, thanks. I hadn't seen that option in the wizard. My screen is lower resolution than recommend and I didn't see it in the list.
What is the file I need to edit? I'm sorry to ask so many questions, but I know nothing of the Acorn customization.
Post Reply