Output Control Both Auto and Manual < Acorn tech support review >

Moderator: cnckeith

legacytorch
Posts: 42
Joined: Fri Dec 29, 2017 2:39 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 985DAD489A3F-1215170079
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Output Control Both Auto and Manual < Acorn tech support review >

Post by legacytorch »

Ok, so in over my head again.

I have my preheat and cut solenoids working very well in place of the flood and mist. (see previous thread viewtopic.php?f=60&t=1354)

The m code works great in auto mode and the keyboard works great in manual. But now I want to be complicated and develop a hybrid mode. I would like to be able to manually operate them at the start of the cut and have the m code shut them off at the end. I tried creating new macros and mapping the function keys to the outputs hopping that I would avoid the inherent limitations of the coolant keys. I successfully mapped the keys to the outputs, but there were two problems. One is that I prefer the toggling of the coolant buttons one button both on and off. When I used an AUX key I needed to use separate keys for on and off. The other problem is that the AUX keys did not function while the program was active. I assume that both of these problems are because I have no idea what I am doing.

So what I am asking is it more feasible to allow simultaneous manual and auto control of the coolant function or to enable manual control of an AUX key during the running cycle?

I tried playing around in the PLC code a bit, hoping to remove the restrictions between auto and manual but it's over my head. This is the area I was experimenting in.

Code: Select all

;--Coolant Functions

;--Toggle auto coolant mode
IF CoolAutoManKey || KbTogCoolAutoMan_M || SkinCoolAutoMan_M THEN (CoolantAutoManualPD)

IF (!CoolAutoModeLED && CoolantAutoManualPD) || OnAtPowerUp_M
  THEN SET CoolAutoModeLED

IF (CoolAutoModeLED && CoolantAutoManualPD)
  THEN RST CoolAutoModeLED

;--Report coolant mode to CNC12
IF CoolAutoModeLED THEN (SelectCoolAutoMan)

;--Display coolant mode message
;changing to auto coolant mode ;2050 Auto Coolant Selected 2 + 50*256
IF (!CoolAutoModeLED && CoolantAutoManualPD && AllowKbInput_M)
  THEN InfoMsg_W = AUTO_COOL_MSG

;changing to manual coolant mode ;2051 Manual Coolant Selected 2 + 51*256
IF (CoolAutoModeLED && CoolantAutoManualPD && AllowKbInput_M)
  THEN InfoMsg_W = MAN_COOL_MSG

;--Flood coolant on/off
;
;  Toggle on/off or off/on if:
;    In manual mode and a toggle key was pressed
;  Turn on if:
;    In auto mode and have M8
;  Turn off if:
;    Any fault or error
;    In auto mode and don't have M8
;    Doing tool check (?)
IF CoolFloodKey || KbFloodOnOff_M || SkinCoolFlood_M THEN (CoolantFloodPD)
IF ((Flood ^ (!CoolAutoModeLED && CoolantFloodPD))
   || CoolAutoModeLED && M8)
   && !(SV_STOP ||
        CoolAutoModeLED && !M8 ||
        ErrorFlag_M ||
        DoToolCheck)
  THEN (Flood), (CoolFloodLED), (SelectCoolantFlood)

;--Mist coolant on/off
IF (CoolMistKey || KbMistOnOff_M || SkinCoolMist_M) THEN (CoolantMistPD)
IF ((Mist ^ (!CoolAutoModeLED && CoolantMistPD))
   || CoolAutoModeLED && M7)
   && !(SV_STOP ||
        CoolAutoModeLED && !M7 ||
        ErrorFlag_M ||
        DoToolCheck)
  THEN (Mist), (CoolMistLED), (SelectCoolantMist)
No success just a bunch of compiling errors.


diycncscott

Re: Output Control Both Auto and Manual

Post by diycncscott »

No success just a bunch of compiling errors.
Really doesn't offer us anything to go on. Please post a report.

Does it matter whether the keys are the mist and flood or would any 2 aux keys work? Any particular m function numbers?


legacytorch
Posts: 42
Joined: Fri Dec 29, 2017 2:39 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 985DAD489A3F-1215170079
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: Output Control Both Auto and Manual

Post by legacytorch »

Really doesn't offer us anything to go on. Please post a report.
My apologies for being vague. I just made a back up copy of all the original files and got in there and tried removing different code pertaining to auto and manual coolant. Honestly pretty haphazard, not my proudest moment. I doubt anything I did was helpful.

I'm not stuck on the flood and mist, it's just where I started and I had success this far. Other keys will work, I use the xbox controller anyway.
I'm sure any M code will work as well.


diycncscott

Re: Output Control Both Auto and Manual

Post by diycncscott »

1. Start with a standard PLC program with Flood and Mist outputs assigned.

2. Replace the "Coolant Functions" section with the code below:

Code: Select all

;--Coolant Functions
;If a flood key is pressed, fire one shot
IF (CoolFloodKey || KbFloodOnOff_M || SkinCoolFlood_M) 
  THEN (CoolantFloodPD)

;If one shot is fired and Flood output is not on OR
;M8 is issued, turn on Flood and Mist  
IF (CoolantFloodPD && !Flood) || M8 THEN SET Flood, SET Mist

;If one shot is fired and Flood output is on OR
;M8 is not set AND the output had been turned on with M8, turn off Flood and Mist  
IF (CoolantFloodPD && Flood) || (!M8 && AutoFlag_M)
  THEN RST Flood, RST Mist

;If M8 is active and Flood is on, set flag  
IF M8 && Flood THEN SET AutoFlag_M

;If output is not on, rst flag.
IF !Flood THEN RST AutoFlag_M  

;Turn on LED if output is on
IF Flood THEN(CoolFloodLED)

3. Add AutoFlag_M IS MEM10 in the Memory Bit Definitions section.

4. Save and recompile.

Pressing the flood key will turn on both flood and mist, pressing it again will them off. The state of the FloodLED will reflect the state of the Flood and Mist outputs. If the outputs were last turned on using M8 in a program, the outputs will be turned off automatically when the job ends. If they were last turned on manually, they will stay on.


legacytorch
Posts: 42
Joined: Fri Dec 29, 2017 2:39 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 985DAD489A3F-1215170079
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: Output Control Both Auto and Manual

Post by legacytorch »

I'm not really looking to have the functions joined, independent control is working well as far as I can tell. I am looking to be able to have them enabled manually and disabled automatically. The scenario is as follows:
  • M00 pause before part
  • manually engage preheat
  • operator determines dwell time, engages cut solenoid (preheat remains active)
  • cycle start to run part
  • Part complete, m code to disengage preheat and cut solenoids
  • rapid move to next part
  • M00 to wait and repeat at next part
Is it possible to remove the distinction between auto and manual and allow free control by either m code or manually? I know that that introduces the possibility for a conflict but that would be up to the operator to avoid.

The full auto setup functions as I want. That is used when using new steel. Sometimes in our shop we do repair work and the non uniform nature of the metal necessitates manual control.


diycncscott

Re: Output Control Both Auto and Manual

Post by diycncscott »

Then remove mist output from what I've provided and then do the same thing I did with M8/Flood/Flood keys but for M7/Mist/Mist keys...


legacytorch
Posts: 42
Joined: Fri Dec 29, 2017 2:39 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 985DAD489A3F-1215170079
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: Output Control Both Auto and Manual

Post by legacytorch »

Still not doing what I need. This is what I changed in the PLC. It compiled fine.

Code: Select all

;--Coolant Functions
;If a flood key is pressed, fire one shot
IF (CoolFloodKey || KbFloodOnOff_M || SkinCoolFlood_M) 
  THEN (CoolantFloodPD)

;If a mist key is pressed, fire one shot
IF (CoolMistKey || KbMistOnOff_M || SkinCoolMist_M) 
  THEN (CoolantMistPD)

;If one shot is fired and Flood output is not on OR
;M8 is issued, turn on Flood and Mist  
IF (CoolantFloodPD && !Flood) || M8 THEN SET Flood

;If one shot is fired and Flood output is not on OR
;M7 is issued, turn on Flood and Mist  
IF (CoolantMistPD && !Mist) || M7 THEN SET Mist

;If one shot is fired and Flood output is on OR
;M8 is not set AND the output had been turned on with M8, turn off Flood and Mist  
IF (CoolantFloodPD && Flood) || (!M8 && AutoFlag_M)
  THEN RST Flood, RST Mist

;If M8 is active and Flood is on, set flag  
IF M8 && Flood THEN SET AutoFlag_M

;If output is not on, rst flag.
IF !Flood THEN RST AutoFlag_M  

;Turn on LED if output is on
IF Flood THEN(CoolFloodLED)

;If one shot is fired and Flood output is on OR
;M7 is not set AND the output had been turned on with M7, turn off Flood and Mist  
IF (CoolantMistPD && Mist) || (!M7 && AutoFlag_M)
  THEN RST Flood, RST Mist

;If M8 is active and Flood is on, set flag  
IF M7 && Mist THEN SET AutoFlag_M

;If output is not on, rst flag.
IF !Mist THEN RST AutoFlag_M  

;Turn on LED if output is on
IF Mist THEN(CoolMistLED)
It apears to function exactly as it did before. Full auto works and full manual works but the combo does not.

This is the post I am using.

Code: Select all

firstPierceTime = 0 --this is an extra delay added to the first pierce as needed by some machines


function OnAbout(event)
   ctrl = event:GetTextCtrl()
   ctrl:AppendText("Centroid plasma post processor\n")
   ctrl:AppendText("\n")
   ctrl:AppendText("Generic plasma post for machines without THC\n")
   ctrl:AppendText("\n")
   ctrl:AppendText("Modal G-codes and coordinates\n")
   ctrl:AppendText("Comments enclosed with ( and )\n")
   ctrl:AppendText("M07 preheat, M08 cut\n")
   ctrl:AppendText("Incremental IJ\n")
end



function OnInit()

   post.SetCommentChars ("()", "[]")  --make sure ( and ) characters do not appear in system text
   post.Text (" (Filename: ", fileName, ")\n")
   post.Text (" (Post processor: ", postName, ")\n")
   post.Text (" (Date: ", date, ")\n")
   if(scale == metric) then
      post.Text (" G21 (Units: Metric)\n") --metric mode
   else
      post.Text (" G20 (Units: Inches)\n") --inch mode
   end
--   post.Text (" G53 G90 G91.1 G40\n F1\n S500\n")
   bigArcs = 1 --stitch arc segments together
   minArcSize = 0.05 --arcs smaller than this are converted to moves
   firstPierce = firstPierceTime;
end

function OnNewLine()
   post.Text ("N")
   post.Number (lineNumber, "0000")
   lineNumber = lineNumber + 10
end


function OnFinish()
   post.Text (" M05\n M30\n")
end

function OnRapid()
   post.ModalText (" G00")
   post.ModalNumber (" X", endX * scale, "0.0000")
   post.ModalNumber (" Y", endY * scale, "0.0000")
   post.ModalNumber (" Z", endZ * scale, "0.0000")
   post.Eol()
end

function OnMove()
   post.ModalText (" G01")
   post.ModalNumber (" X", endX * scale, "0.0000")
   post.ModalNumber (" Y", endY * scale, "0.0000")
   post.ModalNumber (" Z", endZ * scale, "0.0000")
   post.ModalNumber (" F", feedRate * scale, "0.0###")
   post.Eol()
end

function OnArc()
   if(arcAngle <0) then
      post.ModalText (" G03")
   else
      post.ModalText (" G02")
   end
   post.NonModalNumber (" X", endX * scale, "0.0000")
   post.NonModalNumber (" Y", endY * scale, "0.0000")
   post.ModalNumber (" Z", endZ * scale, "0.0000")
   post.Text (" I")
   post.Number ((arcCentreX - currentX) * scale, "0.0000")
   post.Text (" J")
   post.Number ((arcCentreY - currentY) * scale, "0.0000")
   post.ModalNumber (" F", feedRate * scale, "0.0###")
   post.Eol()
end


function OnPenDown()
   post.Text (" M00\n")
end


function OnPenUp()
   post.Text (" M09\n")
   if (endDelay > 0) then
      post.Text (" G04 P")
      post.Number (endDelay,"0.###")
      post.Eol()
   end
end


function OnNewOperation()
   post.Text (" (Operation: ", operationName, ")\n")
end

function OnComment()
  post.Text(" (",commentText,")\n")
end

function OnToolChange()
   post.Text (" M06 T")
   post.Number (tool, "0")
   post.ModalNumber(" F",feedRate * scale,"0.0###")
   post.Text ("  (", toolName, ")\n")
   if (plungeRate <= 0) then
      post.Warning("WARNING: Plunge rate is zero")
   end
   if (feedRate <= 0) then
      post.Warning("WARNING: Feed rate is zero")
   end
end

function OnNewPart()
   post.Text(" (Part: ",partName,")\n");
end

function OnDrill()
   OnRapid()
   OnPenDown()
   endZ = drillZ
   OnMove()
   OnPenUp()
   endZ = safeZ
   OnRapid()
end
The full auto post is the same but the pendown code is changed.

Code: Select all

function OnPenDown()
   if (preheat > 0.001) then
      post.ModalText (" G00")
      post.ModalNumber (" Z", cutHeight * scale, "0.0000")
      post.Text("\n M07")
      post.Text ("\n G04 P")
      post.Number (preheat,"0.###")
      post.Eol()
   end
   post.ModalText (" G00")
   post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
   post.Text ("\n M08\n")
   if (pierceDelay > 0.001) then
      post.Text (" G04 P")
      post.Number (pierceDelay + firstPierce,"0.###")
      firstPierce = 0
      post.Eol()
   end
end
I recognize that this is outside the bounds of normal forum helpfulness and I am willing to pay to make this work.


diycncscott

Re: Output Control Both Auto and Manual

Post by diycncscott »

Give me a call at 814-353-9256 ext 112.

Please download Teamviewer12 here: http://download.teamviewer.com/download ... _Setup.exe

Install it and have your TV id and password ready.


legacytorch
Posts: 42
Joined: Fri Dec 29, 2017 2:39 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 985DAD489A3F-1215170079
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: Output Control Both Auto and Manual

Post by legacytorch »

Thanks a ton Scott. Very impressed with what you all did there remotely. The semi auto mode works great now.

Unfortunately... new problem. Full auto is not working. Program runs feed hold when it calls for a dwell after the preheat. If I cycle start it activates the cut and continues like it should, but it will not advance on its own.


diycncscott

Re: Output Control Both Auto and Manual

Post by diycncscott »

M0 requires a cycle start. M1 is optional

Can you post g code?


Post Reply