EsoErik

Tuesday, April 10, 2018

 

Converting Siemens NX CL NURBS to Siemens 840D NC

Siemens NX CAM includes a post processor infrastructure that is larger than the universe and no less complex. God only fucking knows what's up with all that TCL code. God only cares. So, tossing the entire Siemens NX CAM post processor infrastructure straight into the dumper, just because we childishly decide we don't like it, on an infantile whim, what are we left with? (*smash*)

Generating an NX CAM toolpath for an operation still shows a toolpath on the screen. We still have a DMU65 UL (Ultrasonic+Lathe) to control, and it has Siemens 840D SL control. It's all under control. Well, will be soon.

That on-screen toolpath can be listed. Its listing is like:

TOOL PATH/REST_MILLING,TOOL,CAPS32SR120
TLDATA/MILL,0.5000,0.1200,4.0000,0.0000,0.0000
MSYS/0.0000,0.0000,0.0000,1.0000000,0.0000000,0.0000000,0.0000000,1.0000000,0.0000000
$$ centerline data
PAINT/PATH
PAINT/SPEED,10
LOAD/TOOL,245
PAINT/COLOR,186
RAPID
GOTO/-2.1000,1.2004,2.1000,0.0000000,0.0000000,1.0000000
PAINT/COLOR,211
RAPID
GOTO/-2.1000,1.2004,1.4538
PAINT/COLOR,42
FEDRAT/IPM,10.0000
GOTO/-2.1000,1.2004,1.3538
GOTO/-1.8500,1.5072,1.3538
PAINT/COLOR,31
GOTO/-1.7710,1.5994,1.3538
NURBS/
KNOT/1.0000000
CNTRL/-1.6893,1.6898,1.3538
CNTRL/-1.6017,1.7730,1.3538
CNTRL/-1.5072,1.8500,1.3538
PAINT/COLOR,37
GOTO/-1.2004,2.1000,1.3538
GOTO/-1.2004,2.1000,1.4538
PAINT/COLOR,211
RAPID
GOTO/-1.2004,2.1000,2.1000
PAINT/COLOR,186
RAPID
GOTO/-2.1000,0.9335,2.1000
PAINT/COLOR,211
RAPID
GOTO/-2.1000,0.9335,1.4538
PAINT/COLOR,42
GOTO/-2.1000,0.9335,1.3538
GOTO/-1.8500,1.2916,1.3538
PAINT/COLOR,31
GOTO/-1.7711,1.3978,1.3538
NURBS/
KNOT/1.0000000
CNTRL/-1.6346,1.5709,1.3538
CNTRL/-1.4724,1.7238,1.3538
CNTRL/-1.2916,1.8500,1.3538
PAINT/COLOR,37
GOTO/-0.9335,2.1000,1.3538
GOTO/-0.9335,2.1000,1.4538
PAINT/COLOR,211
RAPID
GOTO/-0.9335,2.1000,2.1000
PAINT/COLOR,186
RAPID
GOTO/-2.1000,0.6068,2.1000
PAINT/COLOR,211
RAPID
GOTO/-2.1000,0.6068,1.4538
PAINT/COLOR,42
GOTO/-2.1000,0.6068,1.3538
GOTO/-1.8500,1.0481,1.3538
PAINT/COLOR,31
GOTO/-1.7838,1.1571,1.3538
NURBS/
KNOT/0.0625000,0.3125000,0.4375000,0.5625000,0.8125000,0.9375000,1.0000000
CNTRL/-1.7716,1.1745,1.3538
CNTRL/-1.7126,1.2629,1.3538
CNTRL/-1.6205,1.3801,1.3538
CNTRL/-1.5040,1.5040,1.3538
CNTRL/-1.3801,1.6205,1.3538
CNTRL/-1.2462,1.7258,1.3538
CNTRL/-1.1212,1.8066,1.3538
CNTRL/-1.0662,1.8389,1.3538
CNTRL/-1.0481,1.8500,1.3538
PAINT/COLOR,37
GOTO/-0.6068,2.1000,1.3538
GOTO/-0.6068,2.1000,1.4538
PAINT/COLOR,211
RAPID
GOTO/-0.6068,2.1000,2.1000
PAINT/COLOR,186
RAPID
GOTO/-2.1000,0.1335,2.1000
PAINT/COLOR,211
RAPID
GOTO/-2.1000,0.1335,1.4538
PAINT/COLOR,42
GOTO/-2.1000,0.1335,1.3538
GOTO/-1.8500,0.7501,1.3538
PAINT/COLOR,31
GOTO/-1.8003,0.8625,1.3538
NURBS/
KNOT/0.0416667,0.9583333,1.0000000
CNTRL/-1.7906,0.8805,1.3538
CNTRL/-1.5821,1.3034,1.3538
CNTRL/-1.2036,1.6593,1.3538
CNTRL/-0.7686,1.8414,1.3538
CNTRL/-0.7501,1.8500,1.3538

Great! We really need some clue what 840D SL wants as input, however. Let's reach into the dumperino and run our NX post one last time. It outputs:

N340 T="CAPS32SR120"
N350 M6
N370 TRAFOOF
N420 ;
N430 ;Initial Move
N440 CYCLE832(_camtolerance,0,1)
N450 TRAORI
N460 G54
N470 ;
N480 ORIWKS
N490 ORIAXES
N500 G0 C0.0 A0.0
N510 G0 X-2.1 Y1.2003965 Z2.1 S0 D0 M3
N520 ;Approach Move
N530 Z1.4538064
N540 ;Engage Move
N550 G1 Z1.3538064 M8 F10.
N560 X-1.85 Y1.5072473
N570 ;Cutting
N580 X-1.7709655 Y1.5993672
N590 BSPLINE SD=3 X-1.6892636 Y1.6898064 PL=0.0
N600 X-1.601724 Y1.7730024 PL=1.
N610 X-1.5072473 Y1.85 PL=0.0
N620 ;Retract Move
N630 G1 X-1.2003965 Y2.1
N640 Z1.4538064
N650 ;Departure Move
N660 G0 Z2.1
N670 X-2.1 Y.9335334
N680 ;Approach Move
N690 Z1.4538064
N700 ;Engage Move
N710 G1 Z1.3538064
N720 X-1.85 Y1.2916128
N730 ;Cutting
N740 X-1.7711318 Y1.397804
N750 BSPLINE SD=3 X-1.6346003 Y1.5708928 PL=0.0
N760 X-1.472405 Y1.7238462 PL=1.
N770 X-1.2916128 Y1.85 PL=0.0
N780 ;Retract Move
N790 G1 X-.9335334 Y2.1
N800 Z1.4538064
N810 ;Departure Move
N820 G0 Z2.1
N830 X-2.1 Y.6068384
N840 ;Approach Move
N850 Z1.4538064
N860 ;Engage Move
N870 G1 Z1.3538064
N880 X-1.85 Y1.0481092
N890 ;Cutting
N900 X-1.7838374 Y1.1571332
N910 BSPLINE SD=3 X-1.7715783 Y1.1745064 PL=0.0
N920 X-1.7126259 Y1.2629285 PL=.0625
N930 X-1.6205476 Y1.3801208 PL=.25
N940 X-1.5039659 Y1.5039613 PL=.125
N950 X-1.3800976 Y1.620521 PL=.125
N960 X-1.2462019 Y1.7258162 PL=.25
N970 X-1.1212275 Y1.8066001 PL=.125
N980 X-1.0662174 Y1.838871 PL=.0625
N990 X-1.0481092 Y1.85 PL=0.0
N1000 ;Retract Move
N1010 G1 X-.6068385 Y2.1
N1020 Z1.4538064
N1030 ;Departure Move
N1040 G0 Z2.1
N1050 X-2.1 Y.1334575
N1060 ;Approach Move
N1070 Z1.4538064
N1080 ;Engage Move
N1090 G1 Z1.3538064
N1100 X-1.85 Y.7500681
N1110 ;Cutting
N1120 X-1.8003415 Y.8624805
N1130 BSPLINE SD=3 X-1.7906448 Y.8804501 PL=0.0
N1140 X-1.5821199 Y1.3034044 PL=.041667
N1150 X-1.2035841 Y1.6593227 PL=.916667
N1160 X-.7686003 Y1.8414274 PL=.041667
N1170 X-.7500682 Y1.85 PL=0.0
N1180 ;Retract Move
N1190 G1 X-.1334575 Y2.1
N1200 Z1.4538064
N1210 ;Departure Move
N1220 G0 Z2.1
N1230 X-2.1 Y-.0019108
N1240 ;Approach Move
N1250 Z1.4538064
N1260 ;Engage Move
N1270 G1 Z1.3538064
N1280 X-1.8829413
N1290 X-1.85 Y.2459095
N1300 ;Cutting
N1310 X-1.8300015 Y.36615
N1320 BSPLINE SD=3 X-1.8249937 Y.3858213 PL=0.0
N1330 X-1.7448088 Y.7636433 PL=.026316
N1340 X-1.3503773 Y1.4416025 PL=.473684
N1350 X-.6481162 Y1.7909367 PL=.473684
N1360 X-.2658658 Y1.846287 PL=.026316
N1370 X-.2459095 Y1.85 PL=0.0
N1380 ;Retract Move
N1390 G1 X.0019107 Y1.8829413
N1400 Y2.1
N1410 Z1.4538064
N1420 ;Departure Move
N1430 G0 Z2.1
N1440 X1.2003965
N1450 ;Approach Move
N1460 Z1.4538064
N1470 ;Engage Move
N1480 G1 Z1.3538064

This correspondence is trivial:

GOTO/-2.1000,1.2004,2.1000,0.0000000,0.0000000,1.0000000

N500 G0 C0.0 A0.0
N510 G0 X-2.1 Y1.2003965 Z2.1 S0 D0 M3

NX CAM specifies X,Y,Z,A3,B3,C3, where A3, B3, and C3 are tool orientation unit vector components. The NX post processor outputted A and C axis angles in degrees, but that's shit. Our machine understands unit vector orientation just fine. Fortunately, we don't have to worry any more about that, because this toolpath is prismatic. We'll deal with simultaneous five axis NURBS toolpaths some other time. NX doesn't seem to want to generate such things, anyway.

Moving on:

GOTO/-1.7710,1.5994,1.3538
NURBS/
KNOT/1.0000000
CNTRL/-1.6893,1.6898,1.3538
CNTRL/-1.6017,1.7730,1.3538
CNTRL/-1.5072,1.8500,1.3538

N580 X-1.7709655 Y1.5993672
N590 BSPLINE SD=3 X-1.6892636 Y1.6898064 PL=0.0
N600 X-1.601724 Y1.7730024 PL=1.
N610 X-1.5072473 Y1.85 PL=0.0

"It's a NURBS! Look out, sir! ARRRRGGGG!!!" No worries, I got this for ya. So, we see some shit going on. KNOT/1.0 clearly means something, but I'm not seeing it represented in our NC, unless it's that PL=1 term. Could be. And then there's those PL=0s. And the SD=3. Either these things are implicit, or our listing is woefully incomplete and will not serve our needs. I can believe that SD3 is implicit - sure, we're always working with cubic NURBS.

Unfortunately, we haven't yet made enough ill-gotten assumptions to fully misunderstand the situation. Let's extrapolate more.

NURBS/
KNOT/0.0625000,0.3125000,0.4375000,0.5625000,0.8125000,0.9375000,1.0000000
CNTRL/-1.7716,1.1745,1.3538
CNTRL/-1.7126,1.2629,1.3538
CNTRL/-1.6205,1.3801,1.3538
CNTRL/-1.5040,1.5040,1.3538
CNTRL/-1.3801,1.6205,1.3538
CNTRL/-1.2462,1.7258,1.3538
CNTRL/-1.1212,1.8066,1.3538
CNTRL/-1.0662,1.8389,1.3538
CNTRL/-1.0481,1.8500,1.3538

N910 BSPLINE SD=3 X-1.7715783 Y1.1745064 PL=0.0
N920 X-1.7126259 Y1.2629285 PL=.0625
N930 X-1.6205476 Y1.3801208 PL=.25
N940 X-1.5039659 Y1.5039613 PL=.125
N950 X-1.3800976 Y1.620521 PL=.125
N960 X-1.2462019 Y1.7258162 PL=.25
N970 X-1.1212275 Y1.8066001 PL=.125
N980 X-1.0662174 Y1.838871 PL=.0625
N990 X-1.0481092 Y1.85 PL=0.0

There's definitely a relationship between KNOT and PL values. Our KNOTs are
[0.0625, 0.3125, 0.4375, 0.5625, 0.8125, 0.9375, 1.0] and our PLs are
[0.0, 0.0625, 0.25, 0.125, 0.125, 0.25, 0.125, 0.0625, 0.0]. Let's prepend a 0 and append a 1 to our KNOTs, giving
[0, 0.0625, 0.3125, 0.4375, 0.5625, 0.8125, 0.9375, 1.0, 1]. In Python list generator syntax, [KNOTs[n]-KNOTs[n-1] for n in range(1,len(PLs))] produces
[0.0625, 0.25, 0.125, 0.125, 0.25, 0.125, 0.0625, 0.0]. These happen to be our PL values.

And that's that. The next step for me is to encode all of these assumptions into a Python script that takes a path listing as input and outputs 840D NC. I will do so here.
Comments:

Post a Comment

Subscribe to Post Comments [Atom]





<< Home

Archives

July 2009   August 2009   September 2009   October 2009   November 2009   December 2009   January 2010   September 2010   December 2010   January 2011   February 2011   April 2011   June 2011   August 2011   February 2012   June 2012   July 2012   August 2012   October 2012   November 2012   January 2014   April 2014   June 2014   August 2014   September 2014   October 2014   January 2015   March 2015   April 2015   June 2015   November 2015   December 2015   January 2016   June 2016   August 2016   January 2017   March 2017   April 2018  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]