UCCNC Postprocessor Assistance

Having problems with or questions about SheetCam? Post them here.
Post Reply
laki
Posts: 17
Joined: Sun Jan 21, 2018 10:28 pm
Location: Belgrade
Contact:

UCCNC Postprocessor Assistance

Post by laki »

I am trying to customize the post processor for Uccnc and would ask for help.

I have a scriber installed on my DIY Cnc Plasma machine on the Z axis next to the plasma torch. The Scriber is located on a linear guide and is driven by a pneumatic cylinder.
In the post processor, I changed the way it works so that the Scribe solenoid is activated (M8) at the beginning of the Plate marker operation and deactivated with M9 at the end of this operation. There is no unnecessary raising (M9) and lowering (M8) of the scriber during this operation. I also managed to insert the variables "Scribe Plunge Speed" and "Scribe Plunge Distance" into the post processor. Scriber now descends from the SafeZ position to the "Scribe Plunge Distance" by a rapid movement (G00) and continues into the material with the movements of the "Scribe Plunge Speed" G01. This way, the Tig tungsten I use for engraving stays sharp longer and the engraved lines look better.

I need help with the following:
For scribe operations I have added referencing independent of plasma tools. Also for Scribe the “touch off sequence” happens exactly where the next plate marker segment begins.

I added a variable to the post processor:
post.DefineCustomOption ("Scribe Ref Distance", "ScribeRef", sc.unitLINEAR, 0, 10000)

Code: Select all

function OnPenDown ()
if (toolClass == "MarkerTool" or tool> 99) then
      if (dist> = "ScribeRef") then
         dist = 0
         References ();
      end
This works but it is not clear to me what this distance refers to. For parts that are spaced 400mm apart, I had to enter a spacing of 1400mm for referencing to happen where needed.
post options.jpg
post options.jpg (99.81 KiB) Viewed 2416 times
Files:
TEST_Post.job
(30.09 KiB) Downloaded 50 times
Postprocessor_macros .zip
(127.48 KiB) Downloaded 58 times
laki
Posts: 17
Joined: Sun Jan 21, 2018 10:28 pm
Location: Belgrade
Contact:

Re: UCCNC Postprocessor Assistance

Post by laki »

G-code:

Code: Select all

N0010 (Filename: TEST_Post.tap)
N0020 (Post processor: LAKI UCCNC_THC_Engraver_PeckDrill_1st.scpost)
N0030 (Date: 01/03/2021)
N0040 G21 (Units: Metric)
N0050 F1
N0060 G53 G90 G40
N0070 M21037 (Relay for THC signals ON)
N0080 M20010 (Safe Probe ON)
N0090 (Part: New part)
N0100 (Operation: No Offset, ENG, Plate marker)
N0110 M08
N0120 G00 X69.5829 Y106.1508
N0130 M09
N0140 M20011 (Safe Probe OFF)
N0150 G31 Z -100 F500.0
N0160 G92 Z0.0
N0170 G00 Z1.2500
N0180 G92 Z0.0
N0190 G00 Z26.0000
N0200 M20010 (Safe Probe ON)
N0210 M08
N0220 Z20.0000
N0230 X89.5829 Y126.1508
N0240 Z9.0000
N0250 G01 Z6.0000 F300.0
N0260 Y144.1508 F1000.0
N0270 X101.5829 Y126.1508
N0280 Y144.1508
N0290 G00 Z26.0000
N0300 X84.4400
N0310 Z9.0000
N0320 G01 Z6.0000 F300.0
N0330 X73.2971 F1000.0
N0340 Y135.5794
N0350 X80.1543
N0360 G00 Z26.0000
N0370 X73.2971
N0380 Z9.0000
N0390 G01 Z6.0000 F300.0
N0400 Y126.1508 F1000.0
N0410 X84.4400
N0420 G00 Z26.0000
N0430 X120.4400 Y139.8651
N0440 Z9.0000
N0450 G01 Z6.0000 F300.0
N0460 G03 X108.4400 I-6.0000 J-1.8327 F627.3664
N0470 Y130.4365 I12.5886 J-4.7143 F1000.0
N0480 X120.4400 I6.0000 J1.8327 F627.3664
N0490 G01 Y133.0080 F1000.0
N0500 X116.1543
N0510 G00 Z26.0000
N0520 X126.4400 Y126.1508
N0530 Z9.0000
N0540 G01 Z6.0000 F300.0
N0550 Y144.1508 F1000.0
N0560 X133.7257
N0570 G02 Y134.7222 I0.0000 J-4.7143 F471.4286
N0580 G01 X126.4400 F1000.0
N0590 G00 Z26.0000
N0600 X133.2971
N0610 Z9.0000
N0620 G01 Z6.0000 F300.0
N0630 X138.4400 Y126.1508 F1000.0
N0640 G00 Z26.0000
N0650 X141.0114
N0660 Z9.0000
N0670 G01 Z6.0000 F300.0
N0680 X147.8686 Y144.5794 F1000.0
N0690 X154.7257 Y126.1508
N0700 G00 Z26.0000
N0710 X143.1543 Y131.9365
N0720 Z9.0000
N0730 G01 Z6.0000 F300.0
N0740 X152.5829 F1000.0
N0750 G00 Z26.0000
N0760 X156.4400 Y144.1508
N0770 Z9.0000
N0780 G01 Z6.0000 F300.0
N0790 X163.2971 Y125.2937 F1000.0
N0800 X170.1543 Y144.1508
N0810 G00 Z26.0000
N0820 X174.4400 Y135.5794
N0830 Z9.0000
N0840 G01 Z6.0000 F300.0
N0850 Y126.1508 F1000.0
N0860 X185.5829
N0870 G00 Z26.0000
N0880 Y144.1508
N0890 Z9.0000
N0900 G01 Z6.0000 F300.0
N0910 X174.4400 F1000.0
N0920 Y135.5794
N0930 X181.2971
N0940 (Part: New part Duplicate 1)
N0950 G04 P0.4
N0960 G00 Z26.0000
N0970 (Operation: No Offset, ENG, Plate marker)
N0980 X379.5829 Y651.1508
N0990 X359.5829 Y631.1508
N1000 M09
N1010 M20011 (Safe Probe OFF)
N1020 G31 Z -100 F500.0
N1030 G92 Z0.0
N1040 G00 Z1.2500
N1050 G92 Z0.0
N1060 G00 Z26.0000
N1070 M20010 (Safe Probe ON)
N1080 M08
N1090 Z20.0000
N1100 X379.5829 Y651.1508
N1110 Z9.0000
N1120 G01 Z6.0000 F300.0
N1130 Y669.1508 F1000.0
N1140 X391.5829 Y651.1508
N1150 Y669.1508
N1160 G00 Z26.0000
N1170 X374.4400
N1180 Z9.0000
N1190 G01 Z6.0000 F300.0
N1200 X363.2971 F1000.0
N1210 Y660.5794
N1220 X370.1543
N1230 G00 Z26.0000
N1240 X363.2971
N1250 Z9.0000
N1260 G01 Z6.0000 F300.0
N1270 Y651.1508 F1000.0
N1280 X374.4400
N1290 G00 Z26.0000
N1300 X410.4400 Y664.8651
N1310 Z9.0000
N1320 G01 Z6.0000 F300.0
N1330 G03 X398.4400 I-6.0000 J-1.8327 F627.3664
N1340 Y655.4365 I12.5886 J-4.7143 F1000.0
N1350 X410.4400 I6.0000 J1.8327 F627.3664
N1360 G01 Y658.0080 F1000.0
N1370 X406.1543
N1380 G00 Z26.0000
N1390 X416.4400 Y651.1508
N1400 Z9.0000
N1410 G01 Z6.0000 F300.0
N1420 Y669.1508 F1000.0
N1430 X423.7257
N1440 G02 Y659.7222 I0.0000 J-4.7143 F471.4286
N1450 G01 X416.4400 F1000.0
N1460 G00 Z26.0000
N1470 X423.2971
N1480 Z9.0000
N1490 G01 Z6.0000 F300.0
N1500 X428.4400 Y651.1508 F1000.0
N1510 G00 Z26.0000
N1520 X431.0114
N1530 Z9.0000
N1540 G01 Z6.0000 F300.0
N1550 X437.8686 Y669.5794 F1000.0
N1560 X444.7257 Y651.1508
N1570 G00 Z26.0000
N1580 X433.1543 Y656.9365
N1590 Z9.0000
N1600 G01 Z6.0000 F300.0
N1610 X442.5829 F1000.0
N1620 G00 Z26.0000
N1630 X446.4400 Y669.1508
N1640 Z9.0000
N1650 G01 Z6.0000 F300.0
N1660 X453.2971 Y650.2937 F1000.0
N1670 X460.1543 Y669.1508
N1680 G00 Z26.0000
N1690 X464.4400 Y660.5794
N1700 Z9.0000
N1710 G01 Z6.0000 F300.0
N1720 Y651.1508 F1000.0
N1730 X475.5829
N1740 G00 Z26.0000
N1750 Y669.1508
N1760 Z9.0000
N1770 G01 Z6.0000 F300.0
N1780 X464.4400 F1000.0
N1790 Y660.5794
N1800 X471.2971
N1810 G04 P0.4
N1820 G00 Z26.0000
N1830 (Operation: Drill, rupe, CentrePunch, 5 mm Deep)
N1840 (Set machine to 28 AMP)
N1850 (remove  ground clamp)
N1860 M09
N1870 G00 X451.2971 Y640.5794
N1880 G00 Z 20.0 (Lift torch UP for prePierce)
N1890 M21036 (prePierce)
N1900 G00 X451.2971 Y640.5794
N1910 X480.0000 Y555.0000
N1920 M20011 (Safe Probe OFF)
N1930 G31 Z -100 F500.0
N1940 G92 Z0.0
N1950 G00 Z1.2500
N1960 G92 Z0.0
N1970 G00 Z2.0000
N1980 M20010 (Safe Probe ON)
N1990 M21036 (PACK DRILL)
N2000 G04 P1
N2010 Z20.0000
N2020 X320.0000
N2030 M20011 (Safe Probe OFF)
N2040 G31 Z -100
N2050 G92 Z0.0
N2060 G00 Z1.2500
N2070 G92 Z0.0
N2080 G00 Z2.0000
N2090 M20010 (Safe Probe ON)
N2100 M21036 (PACK DRILL)
N2110 G04 P1
N2120 Z20.0000
N2130 Y715.0000
N2140 M20011 (Safe Probe OFF)
N2150 G31 Z -100
N2160 G92 Z0.0
N2170 G00 Z1.2500
N2180 G92 Z0.0
N2190 G00 Z2.0000
N2200 M20010 (Safe Probe ON)
N2210 M21036 (PACK DRILL)
N2220 G04 P1
N2230 Z20.0000
N2240 X480.0000
N2250 M20011 (Safe Probe OFF)
N2260 G31 Z -100
N2270 G92 Z0.0
N2280 G00 Z1.2500
N2290 G92 Z0.0
N2300 G00 Z2.0000
N2310 M20010 (Safe Probe ON)
N2320 M21036 (PACK DRILL)
N2330 G04 P1
N2340 Z20.0000
N2350 (Part: New part)
N2360 (Operation: Drill, rupe, CentrePunch, 5 mm Deep)
N2370 (Set machine to 28 AMP)
N2380 (remove  ground clamp)
N2390 X190.0000 Y30.0000
N2400 M20011 (Safe Probe OFF)
N2410 G31 Z -100
N2420 G92 Z0.0
N2430 G00 Z1.2500
N2440 G92 Z0.0
N2450 G00 Z2.0000
N2460 M20010 (Safe Probe ON)
N2470 M21036 (PACK DRILL)
N2480 G04 P1
N2490 Z20.0000
N2500 X30.0000
N2510 M20011 (Safe Probe OFF)
N2520 G31 Z -100
N2530 G92 Z0.0
N2540 G00 Z1.2500
N2550 G92 Z0.0
N2560 G00 Z2.0000
N2570 M20010 (Safe Probe ON)
N2580 M21036 (PACK DRILL)
N2590 G04 P1
N2600 Z20.0000
N2610 Y190.0000
N2620 M20011 (Safe Probe OFF)
N2630 G31 Z -100
N2640 G92 Z0.0
N2650 G00 Z1.2500
N2660 G92 Z0.0
N2670 G00 Z2.0000
N2680 M20010 (Safe Probe ON)
N2690 M21036 (PACK DRILL)
N2700 G04 P1
N2710 Z20.0000
N2720 X190.0000
N2730 M20011 (Safe Probe OFF)
N2740 G31 Z -100
N2750 G92 Z0.0
N2760 G00 Z1.2500
N2770 G92 Z0.0
N2780 G00 Z2.0000
N2790 M20010 (Safe Probe ON)
N2800 M21036 (PACK DRILL)
N2810 G04 P1
N2820 Z20.0000
N2830 (Operation: Outside Offset, Shape, 40A STEEL 2mm Nozzle 1.2  THC 11V)
N2840 (Set machine to 40 AMP)
N2850 (Put back  ground clamp)
N2860 G00 X190.0000 Y190.0000
N2870 X6.9327 Y12.3632
N2880 M205 (THC ON)
N2890 G00 X6.9327 Y12.3632
N2900 M20011 (Safe Probe OFF)
N2910 G31 Z -100 F500.0
N2920 G92 Z0.0
N2930 G00 Z1.2500
N2940 G92 Z0.0
N2950 G00 Z4.0000
N2960 M20010 (Safe Probe ON)
N2970 M03
N2980 M1032 (wait for ARC OK)
N2990 G04 P0.2
N3000 G01 Z2.0000 F1000.0
N3010 M205 (THC ON)
N3020 F990.0
N3030 X7.0043 Y12.4330 F4633.2
N3040 G02 X12.3632 Y12.3632 I2.6437 J-2.7851 F1872.0
N3050 G03 X20.0000 Y9.2000 I7.6368 J7.6368 F4680.0
N3060 G01 X200.0000
N3070 G03 X210.8000 Y20.0000 I0.0000 J10.8000
N3080 G01 Y200.0000
N3090 G03 X200.0000 Y210.8000 I-10.8000 J0.0000
N3100 G01 X20.0000
N3110 G03 X9.2000 Y200.0000 I0.0000 J-10.8000
N3120 G01 Y20.0000
N3130 G03 X10.5670 Y14.7409 I10.8000 J0.0000
N3140 M206 (THC OFF)
N3150 X12.2231 Y12.5060 I9.4330 J5.2591 F4633.2
N3160 M5 (TORCH OFF)
N3170 G01 X12.3632 Y12.3632 F4446.0
N3180 (Part: New part Duplicate 1)
N3190 G02 Y10.5531 I-0.9051 J-0.9051 F1778.4
N3200 (Operation: Outside Offset, Shape, 40A STEEL 2mm Nozzle 1.2  THC 11V)
N3210 (Set machine to 40 AMP)
N3220 (Put back  ground clamp)
N3230 M05
N3240 G04 P1
N3250 G00 Z20.0000
N3260 X296.9327 Y537.3632
N3270 M205 (THC ON)
N3280 G00 X296.9327 Y537.3632
N3290 M20011 (Safe Probe OFF)
N3300 G31 Z -100 F500.0
N3310 G92 Z0.0
N3320 G00 Z1.2500
N3330 G92 Z0.0
N3340 G00 Z4.0000
N3350 M20010 (Safe Probe ON)
N3360 M03
N3370 M1032 (wait for ARC OK)
N3380 G04 P0.2
N3390 G01 Z2.0000 F1000.0
N3400 M205 (THC ON)
N3410 F990.0
N3420 X297.0043 Y537.4330 F4633.2
N3430 G02 X302.3632 Y537.3632 I2.6437 J-2.7851 F1872.0
N3440 G03 X310.0000 Y534.2000 I7.6368 J7.6368 F4680.0
N3450 G01 X490.0000
N3460 G03 X500.8000 Y545.0000 I0.0000 J10.8000
N3470 G01 Y725.0000
N3480 G03 X490.0000 Y735.8000 I-10.8000 J0.0000
N3490 G01 X310.0000
N3500 G03 X299.2000 Y725.0000 I0.0000 J-10.8000
N3510 G01 Y545.0000
N3520 G03 X300.5670 Y539.7409 I10.8000 J0.0000
N3530 M206 (THC OFF)
N3540 X302.2231 Y537.5060 I9.4330 J5.2591 F4633.2
N3550 M5 (TORCH OFF)
N3560 G01 X302.3632 Y537.3632 F4446.0
N3570 G02 Y535.5531 I-0.9051 J-0.9051 F1778.4
N3580 M05
N3590 G04 P1
N3600 G00 Z20.0000
N3610 X0.0000 Y0.0000
N3620 M20011 (Safe Probe OFF)
N3630 M21038 (Relay for THC signals OFF)
N3640 M05 M30
TEST_Post.tap
(8.72 KiB) Downloaded 49 times
User avatar
djreiswig
Posts: 473
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: UCCNC Postprocessor Assistance

Post by djreiswig »

Usually the refdistance is the total distance of all non rapid moves added together. There is a variable in the post that keeps track of the distance. In my post it's simply called dist. Every move is added to dist and when it goes over the set value a reference is called.
User avatar
Les Newell
Site Admin
Posts: 3661
Joined: Thu May 11, 2006 8:12 pm

Re: UCCNC Postprocessor Assistance

Post by Les Newell »

This code looks funky:

Code: Select all

     if (dist> = "ScribeRef") then
You are comparing a number with the string "ScribeRef". You should remove those quotes.
laki
Posts: 17
Joined: Sun Jan 21, 2018 10:28 pm
Location: Belgrade
Contact:

Re: UCCNC Postprocessor Assistance

Post by laki »

Les, I'm sorry. It's a typo
In the postprocessor is:

Code: Select all

function OnPenDown()
   if(toolClass == "MarkerTool" or tool > 99) then
      --if (firstRef) then
        -- Reference()
         if(dist >= ScribeDistance) then -- if distance > ScribeDistance only than reference
         dist = 0 -- move torch to reference point
         offX = 0 
         offY = 0 
         offZ = 0 
         post.ModalNumber (" X", (currentX + offX) * scale, "0.0000") 
         post.ModalNumber (" Y", (currentY + offY) * scale, "0.0000") 
         post.Eol() 
         Reference(); 
         post.ModalText (" G00")
         post.Text(" Z")
         post.Number (safeZ  * scale, "0.0000")
         post.Eol()
         offX = scriberX
         offY = scriberY
         offZ = scriberZ
         post.ModalNumber (" X", (currentX + offX) * scale, "0.0000")
         post.ModalNumber (" Y", (currentY + offY) * scale, "0.0000") --move scriber into place
         post.Eol()
      end
djreiswig, thanks for the explanation.

Now I understand why I have to enter a higher value.
I thought this value refers to the distance between the parts (newly started contours) and not to the total distance of all non rapid moves added together.
User avatar
djreiswig
Posts: 473
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: UCCNC Postprocessor Assistance

Post by djreiswig »

So it's working now? Make sure you have the variable name exactly the same everywhere. The case is important.
laki
Posts: 17
Joined: Sun Jan 21, 2018 10:28 pm
Location: Belgrade
Contact:

Re: UCCNC Postprocessor Assistance

Post by laki »

Thank you all.
Yes, everything works properly. The only thing I still have to solve is that at the beginning of the G-code when the operation is Plate marker I have an M08 that is redundant and should not be there. But even if I don't manage to solve this, I will be satisfied because I have changed the postprocessor a lot and in the future I will be able to use only this one postprocessor for everything I need.
The UCCNC has a bug that manifests by not registering an ARC OK signal in some cases and the machine starts moving before this signal is present. A macro has been inserted into this modified postprocessor to solve this problem. For safety reasons, I also added that all machine movements (except referencing) are performed with the Safe Probe activated (internal UCCNC function). If during operation the plasma torch hits a distorted, previously cut piece of sheet metal or the plasma torch "sinks into the sheet metal", the movement of the machine stops.
You can see an example in the attached video where I intentionally left THC set to 0 V and where this safety function was activated when the plasma torch, after piercing and passing the THC delay time, descended into the sheet metal.
https://youtu.be/VNdTBygEqy8

To mark small precise holes that will be drilled later, I use a plasma drill operation. The problem with this is that the first mark (hole) was always deeper than the others (and these were deeper than I wanted due to the inability to reduce piercing time and time to execute 2 macros (M3 and M5) in UCCNC). I used to solve this earlier by drawing an additional first hole that served to cycle the torch.
I don't have to do that anymore because I inserted a cycle torch into the postprocessor as well as 1 macro that allows me to have a piercing time of only 100 msec. When the machine performs this marking, the ground clamp is removed and only the pilot arc is active.
This way I get precise, even tiny craters, just like a center punch mark.
mark.jpg
mark.jpg (666.43 KiB) Viewed 2386 times
My doubt was related to the distance of referencing and thank you for explaining this to me.
User avatar
djreiswig
Posts: 473
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: UCCNC Postprocessor Assistance

Post by djreiswig »

If you upload your post and a sample job file, I'm sure we can figure out why you have an extra m08.
laki
Posts: 17
Joined: Sun Jan 21, 2018 10:28 pm
Location: Belgrade
Contact:

Re: UCCNC Postprocessor Assistance

Post by laki »

Hi, djreiswig
I already did that in my first post. The Postprocessor_macros.zip file contains the postprocessor and additional macros for UCCNC.
User avatar
djreiswig
Posts: 473
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: UCCNC Postprocessor Assistance

Post by djreiswig »

Okay. I didn't know if you had modified it after that. I'll try and take a look at it later.
Post Reply