UCCNC, ARC OK and Dwell

If you have a question about the software please ask it here.

Re: UCCNC, ARC OK and Dwell

Postby xnaron » Sun Aug 16, 2020 12:54 am

My Post with your suggested changes. I refactored them a bit

Code: Select all
OperationFlag = 0

function OnAbout(event)
   ctrl = event:GetTextCtrl()
   ctrl:AppendText("UCCNC Plasma Post Processor\n")
   ctrl:AppendText("\n")
   ctrl:AppendText("Modal G-codes and coordinates\n")
   ctrl:AppendText("Comments enclosed with ( and )\n")
   ctrl:AppendText("M03/M05 turn the torch on/off\n")
   ctrl:AppendText("Incremental IJ\n")
   ctrl:AppendText("Designed for use with UCCNC and THC\n")
   ctrl:AppendText("    and a ToucOff Macro M1031\n")
   ctrl:AppendText("With G64 Kerf Width Compensation\n")
   ctrl:AppendText("Post variables:\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 (" G17 G40 G49 G50 G64 G69\n G80 G90 G94\n M205 (THCON)\n F1\n S1\n")
 
   post.SetOptions(post.ARC_SEGMENTS) --break circles or arcs into quadrants
   bigArcs = 1 --stitch arc segments together
   minArcSize = 0.05 --arcs smaller than this are converted to moves
end

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

function OnFinish()
   post.Text (" G0 X0.0 Y0.0 \n")
   post.Text (" M05 M30\n")
   end

function OnRapid()
   if(math.hypot(endX-currentX , endY-currentY) < 0.001 and endZ < currentZ) then return end
   if(OperationFlag == 1) then
      post.Text (" (Operation: ", operationName, ")\n")
      OperationFlag = 0
   end
   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.ModalText(" M1031 (TouchOff)")
   post.Eol()
   post.CancelModalNumbers()
   post.ModalText (" G00")
   post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
   post.Eol()
   post.Text (" M03 (Torch Fire)")
   post.Eol()
   post.Text (" G01 X")
   post.Number (( currentX + 0.001) * scale, "0.0000")
   post.Eol()
   post.Text (" G01 X")
   post.Number ( currentX  * scale, "0.0000")
   post.Eol()
   if (pierceDelay > 0) then
      post.Text (" G04 P")
      post.Number (pierceDelay,"0.000")
      post.Eol()
   end

end

function OnPenUp()
   post.Text (" M05 (Torch Off)")
   post.Eol()
   if (endDelay > 0) then
      post.Text (" G04 P")
      post.Number (endDelay,"0.000")
      post.Eol()
   end
end

function OnNewOperation()
   OperationFlag = 1
end

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

function OnToolChange()
   post.Text (" M06 T")
   post.Number (tool, "0")
   post.Text ("  (", toolName, ")\n")
   post.Text (" G64 Q")   
   post.Number (toolDia * scale / 2, "0.000")
   post.Eol()
end

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

function OnDrill()
   OnRapid()
   OnPenDown()
   endZ = drillZ
   OnMove()
   OnPenUp()
   endZ = safeZ
   OnRapid()
end
xnaron
 
Posts: 25
Joined: Wed Jul 29, 2020 10:41 pm

Re: UCCNC, ARC OK and Dwell

Postby xnaron » Mon Aug 17, 2020 10:26 pm

Installed the AXBB-e mach 3 plugin and it flashed my AXBB firmware (maybe there is a mach 3 specific version). I configured Mach 3 to work with the new controller (only edited ports/pins no other changes). Right away I notice there is a delay when the M3 command is turned on. There is no delay turning it off (m4). I tried changing the M3 output to a different relay but it still had the delay. I have some other buttons mapped to turn on/off relays and they work with no perceptible delay.

https://www.youtube.com/watch?v=HPJM1VuHhyo


I hooked up the old controller (Mach 3 config is the same except for ports and pins). There is no delay turning M3 on. In fact you can here the M3 relay turn on before the light on the mach 3 screen lights up.

Old controller is RNR Motion controller non cncdrive.

https://www.youtube.com/watch?v=Qz5ow2IbOzw
xnaron
 
Posts: 25
Joined: Wed Jul 29, 2020 10:41 pm

Re: UCCNC, ARC OK and Dwell

Postby dfabltd » Tue Aug 18, 2020 8:22 pm

Hello
i have ran test today and still no further
axbb is ignoring arc ok signal
the only way i can control piercing is with spindle delays
thc on, m3, torch fires and takes off before arc ok signal comes
when cutting with arc ok on and thc if i lose arc ok the machine does not stop

anyone any ideas
dfabltd
 
Posts: 4
Joined: Tue Aug 18, 2020 7:44 pm

Previous

Return to Ask a question from support here

Who is online

Users browsing this forum: No registered users and 38 guests

cron