Hello Guest it is September 16, 2019, 07:10:49 PM

Author Topic: lost when it comes to nesting  (Read 4019 times)

0 Members and 1 Guest are viewing this topic.

lost when it comes to nesting
« on: April 28, 2009, 12:30:20 PM »
So I am trying to figure out how to nest. I just want to replicate circles in my y axis, lets say 5 times. I have broken out a text book and read some posts here, but I can't get anything to work. I tried adding L5 in the M98 line to repeat the subprogram but I don't know how to have the subprogram jump a few inches each time it is run. I guess I am supposed to add a Y 5. to add 5 inches each time, but I don't really have a clue.
Thanks
Ben

%
O00100 ( PROGRAM NUMBER)


( PROGRAM NAME - testing_test.TAP)
( DATE - TUE. 04/28/2009)
( TIME - 12:05PM)

N01 G20 G40 G49 G54 G80 G90 G91.1
N02 G53 Z2. F80

( FIRST CUT - FIRST TOOL)

N03 T1
N04 G00 G90 G54 X1. Y0. M05
N05 G43 H1 Z.1 M08
N06 M98 P10 ( SUBPROGRAM CALL)
N07 G00 Z.1
N08 M09
N09 M05
N10 G53 Z2.
N11 G53 X0. Y0.
N12 M02


O10 (SUBPROGRAM OF O100)
G01 Z-.5 F70.
G17 G03 X1. Y0. I-1. J0.
M99 ( SUBPROGRAM RETURN)


( END OF PROGRAM)

N13 M30
%
Re: lost when it comes to nesting
« Reply #1 on: April 28, 2009, 01:56:51 PM »
Been here, done this.

I do love these subs.  They're 1000x more useful than "Wizards", since a Wizard writes an entire file not just one op you have to manually build a combined file, IMHO largely defeating the value of a Wizard.  It's possible to build reusable Subprogs to build square/circular/spiral pockets from passed parameters, including finishing passes, and discard the Wizard method.  This makes the code more flexible, and more readable than Wizard-generated "WTF does this do??" code, but the readability is still quite low.

There are two and only two ways of doing this.

The first is "parameters", which is a variable.  The lable must be a number (not text, that would render the code too readable) and numbered within the acceptable range (at a bit over #5000, Mach has reserved a bunch for system numbers).  Any math done on parameters must be enclosed in [].  It is oddly illegal to have [-#5], it must be [0-#5] or [-1*#5].

#5=1
M98 P10 L3
M30

O10 (OUTWARD SPIRAL)
G01 X#5 Y0 F70
G12 X[#5+0.1] Y0. I-1. J0.
#5=[#5+0.1]
M99 ( SUBPROGRAM RETURN)

The second way is to use incremental moves inside a sub:
O11 (zigzag cut)
G01 X1
G01 X0 (right to left)
G91  G01    Y-0.1 (incremental step down)
G90 (cancel incremental mode)
G01 X1 (left to right)
G91   G01  Y-0.1  (incremental step down)
G90 (cancel incremental mode)
M99

At first this appears to be cleaner since it's not using these messy global parameters.  The idea of using incremental runs into problems if you NEED to know the current XYZ location for part of an equation.  There's no good way to get it.  If it's passed as a parameter, the parameter is known.  My example was a subprog to enlarge a rectangular pocket when passed the X0,Y0 center and the step size, always starting at top left corner.  Didn't want to pass the current XY, thought I could just incrementally move to enlarge it.  OK so I can do an incremental XY move to increase the start point one step out.  Done.  Say #10 is the X0 center.  But then this top right move needs to G0 X[2*#10-Xcurrent].  The code can't access "Xcurrent" thus the solution appears to be impossible. 

There was talk of reconfiguring Mach3 for "macro pumping" to make it possible to see Xcurrent, but it was not only an odd special config but sounded like it may not pass the correct value reliably.

EDIT:
OK, the macro pumping thing does seem to be possible, although there's some odd things you have to do to access it:
http://www.machsupport.com/forum/index.php?topic=11333.new;topicseen#new
« Last Edit: April 28, 2009, 02:22:13 PM by MechanoMan »
Re: lost when it comes to nesting
« Reply #2 on: April 28, 2009, 03:09:10 PM »
Awesome thanks! I didn't know that we could use formulas like that in g-code. It reminds me of Pascal. Now I have something to play with.

Thanks again!

Ben
Re: lost when it comes to nesting
« Reply #3 on: April 28, 2009, 11:02:20 PM »
Ok so I think I am getting there, but I can't get variables to work in the code when I use G17 G03...
%
O00100 ( PROGRAM NUMBER)

( PROGRAM NAME - testing_NEST.TAP)
( DATE - TUE. 04/28/2009)
( TIME - 12:05PM)

N01 G20 G40 G49 G54 G80 G90 G91.1
N02 G53 Z2. F80

#5=0.
M98 P10 L3
M30

O10 (SUB)
   G01 Z-.125 F80
   G17 G02 X1.9375 Y[#5.] I-1.9375 J0. F 70
   #5=[#5+2.]
M99 ( SUBPROGRAM RETURN)

Thanks
Ben
Re: lost when it comes to nesting
« Reply #4 on: April 28, 2009, 11:55:54 PM »
It'd be helpful if you described what the code's intended to do.  Sounds like some odd arcing but I haven't worked it though.  It doesn't look it's written to do something "sane".

Y[#5.] is not correct.  No decimal after a #parameter.

You might wanna start with a simple linear move to try it out.  Circles are kinda confusing to deal with.

Re: lost when it comes to nesting
« Reply #5 on: April 29, 2009, 12:59:21 AM »
In my previous post, that was just a test to get things to work. If I replace the Y[#5] with Y0., things work out perfectly, but once i introduce a variable, the line does not work. I read some other posts, and it seems that others have had luck with using variables. I don't know what I am missing. Another piece of the puzzle is that when using Y[#5] mach3 gives me this code: Radius to end of arc differs from radius to startLine. I have searched this as well and the answer dealt with abs. vs incremental. I tried all of those suggestions and still no luck.

Do I need to scrap the G02 IJ method and just go with using a radius method(i don't kow, I think I read that somewhere...)Sorry for all of the lines of codes.
Btw- I am just making soap dishes out of walnut. They resemble magged bicycle wheels. My sister, a metallurgical engineer, lost her job so she is having a go at soap making. I'm just trying to help her out. I am trying to create more than one at a time since I do not have a ATC.
Once again,
Thanks

%
O00100 ( PROGRAM NUMBER)

( BEGIN PREDATOR NC HEADER)
( MACH_FILE=4AXVMILL.MCH)
( MTOOL T11 S1 D.25 H5. DIAM_OFFSET 11 = .125)
( MTOOL T41 S1 D.375 H1.825 DIAM_OFFSET 41 = .1875)
( MTOOL T16 S1 D.5 H2.75 DIAM_OFFSET 16 = .25)
( SBOX X-2.5 Y-2.5 Z-1. L5. W5. H1.)
( END PREDATOR NC HEADER)

( PROGRAM NAME - MAGS_ROUNDOVER.TAP)
( POST -  MACH 3 MILL NO ATC - BCV23)
( DATE - TUE. 04/28/2009)
( TIME - 07:01PM)

N01 G20 G40 G49 G54 G80 G90 G91.1
N06 G53 Z2. F80

#10=0.
#15=0.
#20=0.
#25=0.
#30=0.
#35=0.
#40=0.
#55=0.
#60=0.
#65=0.
#100=0.
#105=0.
#110=0.
#120=0.
#125=0.

( FIRST CUT - FIRST TOOL)

N11 T11
N16 G00 G90 G54 X-2.5 Y2.5 S504 M03
N21 G43 H11 Z.1 M08
N26 G81 G98 X-2.5 Y2.5 Z-.06 R.1 F40.
N31 M98 P10 L6 ( SUBPROGRAM CALL CENTER DRILL)
N36 M09
N41 M05
N46 G53 Z4. F80
N51 G53 X0. Y0.
N56 M01
N61 G53 Z4.

( NEXT CUT - NEXT TOOL)

N66 T41
N71 G00 G90 G54 X1.9375 Y0. M05
N76 G43 H41 Z.1 M08
N81 M98 P15 L5 ( SUBPROGRAM CALL OUTSIDE ROUNDOVER)
N86 G00 Z.1

( NEXT CUT - SAME TOOL)

N91 G90 G54 X1.5625 Y0.
N96 M98 P20 L5 ( SUBPROGRAM CALL)
N101 G00 Z.1

( NEXT CUT - SAME TOOL)

N106 G90 G54 X-1.1131 Y-.9097
N111 M98 P25 L5 ( SUBPROGRAM CALL)
N116 G00 Z.1

( NEXT CUT - SAME TOOL)

N121 G90 G54 X-.2313 Y1.4188
N126 M98 P30 L5 ( SUBPROGRAM CALL)
N131 G00 Z.1

( NEXT CUT - SAME TOOL)

N136 G90 G54 X1.3443 Y-.5091
N141 M98 P35 L5 ( SUBPROGRAM CALL)
N146 G00 Z.1
N151 M09
N156 M05
N161 G53 Z4. F80
N166 G53 X0. Y0.
N171 M01
N176 G53 Z4.

( NEXT CUT - NEXT TOOL)

N181 T16
N186 G90 G54 X.13 Y0. M05
N191 G43 H16 Z.1 M08
N196 M98 P40 L5 ( SUBPROGRAM CALL)
N201 X-.8801 Y-.802
N206 M98 P55 L5 ( SUBPROGRAM CALL)
N211 X-.2545 Y1.1631
N216 M98 P60 L5 ( SUBPROGRAM CALL)
N221 X1.1345 Y-.3612
N226 M98 P65 L5 ( SUBPROGRAM CALL)

( NEXT CUT - SAME TOOL)

N231 G90 G54 X-.3027 Y2.1538
N236 M98 P100 L5 ( SUBPROGRAM CALL)
N241 G00 Z.1

( NEXT CUT - SAME TOOL)

N246 G90 G54 X.3027 Y-2.1538
N251 M98 P105 L5 ( SUBPROGRAM CALL)
N256 G00 Z.1

( NEXT CUT - SAME TOOL)

N261 G90 G54 X-.2957 Y2.1043
N266 M98 P110 L5 ( SUBPROGRAM CALL)
N271 G00 Z.1

( NEXT CUT - SAME TOOL)

N276 G90 G54 X.2957 Y-2.1043
N281 M98 P115 L5 ( SUBPROGRAM CALL)
N286 G00 Z.1

( NEXT CUT - SAME TOOL)

N291 G90 G54 X.2957 Y2.1043
N296 M98 P120 L5 ( SUBPROGRAM CALL)
N301 G00 Z.1

( NEXT CUT - SAME TOOL)

N306 G90 G54 X-.2957 Y-2.1043
N311 M98 P125 L5 ( SUBPROGRAM CALL)
N316 G00 Z.1
N321 M09
N326 M05
N331 G53 Z2.
N336 G53 X0. Y0.
N341 M02

O10 (SUBPROGRAM OF O100)
X2.5
Y[-2.5+#10]
X-2.5
#10=[#10+5.]
G80
M99 ( SUBPROGRAM RETURN)

O15 (SUBPROGRAM OF O100)
G01 Z-.125 F80.
G17 G03 X1.9375 Y[0.+#15] I-1.9375 J0. F70.
G01 Z-.25 F80.
G03 X1.9375 Y[0.+#15] I-1.9375 J0. F70.
#15=[#15+5.]
M99 ( SUBPROGRAM RETURN)

O20 (SUBPROGRAM OF O100)
G01 Z-.125 F80.
G03 X1.5625 Y[0.+#20] I-1.5625 J0. F70.
G01 Z-.25 F80.
G03 X1.5625 Y[0.+#20] I-1.5625 J0. F70.
#20=[5.+#20]
M99 ( SUBPROGRAM RETURN)

O25 (SUBPROGRAM OF O100)
G01 Z-.125 F80.
G02 X-1.1131 Y[.9097+#25] I1.1131 J.9097 F70.
X-.7235 Y[.8781+#25] I.1839 J-.1503
G01 X-.4459 Y[.3972+#25]
G02 X-.4459 Y[-.3972+#25] I-.6881 J-.3972
G01 X-.7235 Y[-.8781+#25]
G02 X-1.1131 Y[-.9097+#25] I-.2057 J.1188
G01 Z-.25 F80.
G02 X-1.1131 Y[.9097+#25] I1.1131 J.9097 F70.
X-.7235 Y[.8781+#25] I.1839 J-.1503
G01 X-.4459 Y[.3972+#25]
G02 X-.4459 Y[-.3972+#25] I-.6881 J-.3972
G01 X-.7235 Y[-.8781+#25]
G02 X-1.1131 Y[-.9097+#25] I-.2057 J.1188
G01 Z-.375 F80.
G02 X-1.1131 Y[.9097+#25] I1.1131 J.9097 F70.
X-.7235 Y[.8781+#25] I.1839 J-.1503
G01 X-.4459 Y[.3972+#25]
G02 X-.4459 Y[-.3972+#25] I-.6881 J-.3972
G01 X-.7235 Y[-.8781+#25]
G02 X-1.1131 Y[-.9097+#25] I-.2057 J.1188
G01 Z-.5 F80.
G02 X-1.1131 Y[.9097+#25] I1.1131 J.9097 F70.
X-.7235 Y[.8781+#25] I.1839 J-.1503
G01 X-.4459 Y[.3972+#25]
G02 X-.4459 Y[-.3972+#25] I-.6881 J-.3972
G01 X-.7235 Y[-.8781+#25]
G02 X-1.1131 Y[-.9097+#25] I-.2057 J.1188
#25=[#25+5.]
M99 ( SUBPROGRAM RETURN)

O30 (SUBPROGRAM OF O100)
G01 Z-.125 F80.
G02 X1.3443 Y[#30+.5091] I.2313 J-1.4188 F70.
X1.1222 Y[#30+.1875] I-.2221 J-.0841
G01 X.567
G02 X-.1211 Y[#30+.5847] I0. J.7945
G01 X-.3987 Y[#30+1.0656]
G02 X-.2313 Y[#30+1.4188] I.2057 J.1187
G01 Z-.25 F80.
G02 X1.3443 Y[#30+.5091] I.2313 J-1.4188 F70.
X1.1222 Y[#30+.1875] I-.2221 J-.0841
G01 X.567
G02 X-.1211 Y[#30+.5847] I0. J.7945
G01 X-.3987 Y[#30+1.0656]
G02 X-.2313 Y[#30+1.4188] I.2057 J.1187
G01 Z-.375 F80.
G02 X1.3443 Y[#30+.5091] I.2313 J-1.4188 F70.
X1.1222 Y[#30+.1875] I-.2221 J-.0841
G01 X.567
G02 X-.1211 Y[#30+.5847] I0. J.7945
G01 X-.3987 Y[#30+1.0656]
G02 X-.2313 Y[#30+1.4188] I.2057 J.1187
G01 Z-.5 F80.
G02 X1.3443 Y[#30+.5091] I.2313 J-1.4188 F70.
X1.1222 Y[#30+.1875] I-.2221 J-.0841
G01 X.567
G02 X-.1211 Y[#30+.5847] I0. J.7945
G01 X-.3987 Y[#30+1.0656]
G02 X-.2313 Y[#30+1.4188] I.2057 J.1187
#30=[#30+5.]
M99 ( SUBPROGRAM RETURN)

O35 (SUBPROGRAM OF O100)
G01 Z-.125 F80.
G02 X-.2313 Y[#35+-1.4188] I-1.3443 J.5091 F70.
X-.3987 Y[#35+-1.0656] I.0382 J.2344
G01 X-.1211 Y[#35+-.5847]
G02 X.567 Y[#35+-.1875] I.6881 J-.3972
G01 X1.1222
G02 X1.3443 Y[#35+-.5091] I0. J-.2375
G01 Z-.25 F80.
G02 X-.2313 Y[#35+-1.4188] I-1.3443 J.5091 F70.
X-.3987 Y[#35+-1.0656] I.0382 J.2344
G01 X-.1211 Y[#35+-.5847]
G02 X.567 Y[#35+-.1875] I.6881 J-.3972
G01 X1.1222
G02 X1.3443 Y[#35+-.5091] I0. J-.2375
G01 Z-.375 F80.
G02 X-.2313 Y[#35+-1.4188] I-1.3443 J.5091 F70.
X-.3987 Y[#35+-1.0656] I.0382 J.2344
G01 X-.1211 Y[#35+-.5847]
G02 X.567 Y[#35+-.1875] I.6881 J-.3972
G01 X1.1222
G02 X1.3443 Y[#35+-.5091] I0. J-.2375
G01 Z-.5 F80.
G02 X-.2313 Y[#35+-1.4188] I-1.3443 J.5091 F70.
X-.3987 Y[#35+-1.0656] I.0382 J.2344
G01 X-.1211 Y[#35+-.5847]
G02 X.567 Y[#35+-.1875] I.6881 J-.3972
G01 X1.1222
G02 X1.3443 Y[#35+-.5091] I0. J-.2375
#35=[#35+5.]
M99 ( SUBPROGRAM RETURN)

O40 (SUBPROGRAM OF O100)
G01 Z0. F70.
X.1504 Y[#40+-.0009] Z-.0036
X.1707 Y[#40+-.0037] Z-.0072
X.1912 Y[#40+-.0085] Z-.0109
X.2088 Y[#40+-.0142] Z-.0142
X.2271 Y[#40+-.022] Z-.0177
X.2433 Y[#40+-.0305] Z-.0209
X.2559 Y[#40+-.0384] Z-.0235
X.2705 Y[#40+-.0491] Z-.0267
X.2859 Y[#40+-.0625] Z-.0303
X.2976 Y[#40+-.0745] Z-.0333
X.3098 Y[#40+-.0893] Z-.0367
X.3229 Y[#40+-.1086] Z-.0408
X.334 Y[#40+-.1292] Z-.0449
X.3427 Y[#40+-.1502] Z-.0489
X.3488 Y[#40+-.1706] Z-.0527
X.3535 Y[#40+-.1945] Z-.057
X.3553 Y[#40+-.2132] Z-.0603
X.3556 Y[#40+-.2299] Z-.0633
X.3547 Y[#40+-.2463] Z-.0661
X.3524 Y[#40+-.2638] Z-.0693
X.3469 Y[#40+-.2878] Z-.0736
X.3403 Y[#40+-.3075] Z-.0773
X.3328 Y[#40+-.3247] Z-.0806
X.3237 Y[#40+-.3414] Z-.0839
X.3118 Y[#40+-.3594] Z-.0877
X.3 Y[#40+-.374] Z-.091
X.2874 Y[#40+-.3874] Z-.0943
X.2743 Y[#40+-.3992] Z-.0974
X.2567 Y[#40+-.4124] Z-.1013
X.2404 Y[#40+-.4225] Z-.1047
X.2221 Y[#40+-.4317] Z-.1083
X.1996 Y[#40+-.4403] Z-.1125
X.1782 Y[#40+-.4461] Z-.1164
X.1572 Y[#40+-.4497] Z-.1202
X.1324 Y[#40+-.4513] Z-.1246
X.1098 Y[#40+-.4504] Z-.1286
X.0841 Y[#40+-.4466] Z-.1331
X.0588 Y[#40+-.4398] Z-.1378
X.0357 Y[#40+-.4307] Z-.1421
X.0158 Y[#40+-.4203] Z-.1461
X-.0018 Y[#40+-.4088] Z-.1498
X-.0176 Y[#40+-.3963] Z-.1534
X-.0304 Y[#40+-.3844] Z-.1565
X-.0438 Y[#40+-.3695] Z-.16
X-.057 Y[#40+-.352] Z-.1639
X-.0683 Y[#40+-.3334] Z-.1677
X-.0765 Y[#40+-.3166] Z-.171
X-.0837 Y[#40+-.298] Z-.1745
X-.0905 Y[#40+-.2736] Z-.179
X-.0945 Y[#40+-.2486] Z-.1835
X-.0956 Y[#40+-.2269] Z-.1873
X-.0944 Y[#40+-.2018] Z-.1917
X-.0927 Y[#40+-.1894] Z-.1939
X-.0898 Y[#40+-.1747] Z-.1966
X-.0865 Y[#40+-.162] Z-.1989
X-.0817 Y[#40+-.1476] Z-.2015
X-.0763 Y[#40+-.1343] Z-.2041
X-.0692 Y[#40+-.1196] Z-.207
X-.0618 Y[#40+-.1068] Z-.2096
X-.0536 Y[#40+-.0944] Z-.2122
X-.0371 Y[#40+-.074] Z-.2168
X-.0267 Y[#40+-.0633] Z-.2195
X-.0164 Y[#40+-.054] Z-.2219
X-.0062 Y[#40+-.0457] Z-.2242
X.0063 Y[#40+-.0369] Z-.2269
X.0174 Y[#40+-.0301] Z-.2292
X.0312 Y[#40+-.0228] Z-.232
X.0526 Y[#40+-.0137] Z-.2361
X.0666 Y[#40+-.0091] Z-.2387
X.0786 Y[#40+-.0059] Z-.2409
X.104 Y[#40+-.0015] Z-.2454
X.13 Y[#40+0.] Z-.25
G17 G02 X.13 Y[#40+0.] I-.13 J0.
G01 X.38
G02 X.38 Y[#40+0.] I-.38 J0.
G01 X.63
G02 X.63 Y[#40+0.] I-.63 J0.
G01 X.88
G02 X.88 Y[#40+0.] I-.88 J0.
G01 X1.13
G02 X1.13 Y[#40+0.] I-1.13 J0.
G01 X1.38
G02 X1.38 Y[#40+0.] I-1.38 J0.
G00 Z.1
#40=[#40+5.]
M99 ( SUBPROGRAM RETURN)

O55 (SUBPROGRAM OF O100)
G01 Z0. F70.
X-.8729 Y[#55+-.7919] Z-.0022
X-.7174 Y[#55+-.5226] Z-.0571
X-.9339 Y[#55+-.3976] Z-.1011
X-.8118 Y[#55+-.186] Z-.1442
X-.7968 Y[#55+-.1572] Z-.1499
X-.7844 Y[#55+-.1272] Z-.1557
X-.7746 Y[#55+-.0963] Z-.1614
X-.7676 Y[#55+-.0646] Z-.1671
X-.7633 Y[#55+-.0324] Z-.1728
X-.7619 Y[#55+0.] Z-.1785
X-.7633 Y[#55+.0324] Z-.1843
X-.7676 Y[#55+.0646] Z-.19
X-.7746 Y[#55+.0963] Z-.1957
X-.7844 Y[#55+.1272] Z-.2014
X-.7968 Y[#55+.1572] Z-.2072
X-.8118 Y[#55+.186] Z-.2129
X-.9339 Y[#55+.3976] Z-.256
X-.9539 Y[#55+.3469] Z-.2656
X-.9711 Y[#55+.2952] Z-.2752
X-.9856 Y[#55+.2427] Z-.2848
X-.9972 Y[#55+.1895] Z-.2944
X-1.0059 Y[#55+.1358] Z-.304
X-1.0117 Y[#55+.0816] Z-.3136
X-1.0146 Y[#55+.0272] Z-.3232
Y[#55+-.0272] Z-.3328
X-1.0117 Y[#55+-.0816] Z-.3424
X-1.0059 Y[#55+-.1358] Z-.352
X-.9972 Y[#55+-.1895] Z-.3616
X-.9856 Y[#55+-.2427] Z-.3712
X-.9711 Y[#55+-.2952] Z-.3808
X-.9539 Y[#55+-.3469] Z-.3904
X-.9339 Y[#55+-.3976] Z-.4
G02 X-.9339 Y[#55+.3976] I.9339 J.3976
G01 X-.8118 Y[#55+.186]
G02 X-.8118 Y[#55+-.186] I-.3222 J-.186
G01 X-.9339 Y[#55+-.3976]
X-.7174 Y[#55+-.5226]
X-.8729 Y[#55+-.7919]
G02 X-.9795 Y[#55+-.8005] I-.0563 J.0325
X-.9795 Y[#55+.8005] I.9795 J.8005
X-.8729 Y[#55+.7919] I.0503 J-.0411
G01 X-.5952 Y[#55+.311]
G02 X-.5952 Y[#55+-.311] I-.5387 J-.311
G01 X-.7174 Y[#55+-.5226]
G00 Z.1
X-.9978 Y[#55+.1859]
Z-.3
G01 Z-.4 F70.
X-1.0063 Y[#55+.1325] Z-.4096
X-1.0119 Y[#55+.0786] Z-.4191
X-1.0147 Y[#55+.0246] Z-.4286
X-1.0146 Y[#55+-.0296] Z-.4382
X-1.0116 Y[#55+-.0836] Z-.4477
X-1.0057 Y[#55+-.1374] Z-.4573
X-.9969 Y[#55+-.1908] Z-.4668
X-.9853 Y[#55+-.2437] Z-.4764
X-.9709 Y[#55+-.2959] Z-.4859
X-.9538 Y[#55+-.3472] Z-.4955
X-.9339 Y[#55+-.3976] Z-.505
G02 X-.9339 Y[#55+.3976] I.9339 J.3976
G01 X-.8118 Y[#55+.186]
G02 X-.8118 Y[#55+-.186] I-.3222 J-.186
G01 X-.9339 Y[#55+-.3976]
X-.7174 Y[#55+-.5226]
X-.8729 Y[#55+-.7919]
G02 X-.9795 Y[#55+-.8005] I-.0563 J.0325
X-.9795 Y[#55+.8005] I.9795 J.8005
X-.8729 Y[#55+.7919] I.0503 J-.0411
G01 X-.5952 Y[#55+.311]
G02 X-.5952 Y[#55+-.311] I-.5387 J-.311
G01 X-.7174 Y[#55+-.5226]
G00 Z.1
#55=[#55+5.]
M99 ( SUBPROGRAM RETURN)

O60 (SUBPROGRAM OF O100)
G01 Z0. F70.
X-.2493 Y[#60+1.1519] Z-.0022
X-.0939 Y[#60+.8826] Z-.0571
X.1227 Y[#60+1.0076] Z-.1011
X.2448 Y[#60+.796] Z-.1442
X.2622 Y[#60+.7686] Z-.1499
X.282 Y[#60+.7429] Z-.1557
X.3039 Y[#60+.719] Z-.1614
X.3278 Y[#60+.697] Z-.1671
X.3536 Y[#60+.6773] Z-.1728
X.381 Y[#60+.6598] Z-.1785
X.4097 Y[#60+.6449] Z-.1843
X.4397 Y[#60+.6324] Z-.19
X.4707 Y[#60+.6227] Z-.1957
X.5024 Y[#60+.6157] Z-.2014
X.5345 Y[#60+.6114] Z-.2072
X.567 Y[#60+.61] Z-.2129
X.8112 Z-.256
X.7774 Y[#60+.6526] Z-.2656
X.7412 Y[#60+.6934] Z-.2752
X.703 Y[#60+.7321] Z-.2848
X.6627 Y[#60+.7688] Z-.2944
X.6205 Y[#60+.8032] Z-.304
X.5765 Y[#60+.8354] Z-.3136
X.5309 Y[#60+.8651] Z-.3232
X.4837 Y[#60+.8923] Z-.3328
X.4352 Y[#60+.917] Z-.3424
X.3854 Y[#60+.939] Z-.352
X.3345 Y[#60+.9583] Z-.3616
X.2826 Y[#60+.9749] Z-.3712
X.2299 Y[#60+.9886] Z-.3808
X.1765 Y[#60+.9995] Z-.3904
X.1227 Y[#60+1.0076] Z-.4
G02 X.8112 Y[#60+.61] I-.1227 J-1.0076
G01 X.567
G02 X.2448 Y[#60+.796] I0. J.372
G01 X.1227 Y[#60+1.0076]
X-.0939 Y[#60+.8826]
X-.2493 Y[#60+1.1519]
G02 X-.2035 Y[#60+1.2485] I.0563 J.0325
X1.183 Y[#60+.448] I.2035 J-1.2485
X1.1222 Y[#60+.36] I-.0608 J-.023
G01 X.567
G02 X.0283 Y[#60+.671] I0. J.622
G01 X-.0939 Y[#60+.8826]
G00 Z.1
X.6599 Y[#60+.7712]
Z-.3
G01 Z-.4 F70.
X.6179 Y[#60+.8053] Z-.4096
X.5741 Y[#60+.8371] Z-.4191
X.5286 Y[#60+.8665] Z-.4286
X.4817 Y[#60+.8934] Z-.4382
X.4334 Y[#60+.9178] Z-.4477
X.3838 Y[#60+.9396] Z-.4573
X.3332 Y[#60+.9588] Z-.4668
X.2816 Y[#60+.9752] Z-.4764
X.2292 Y[#60+.9888] Z-.4859
X.1762 Y[#60+.9996] Z-.4955
X.1227 Y[#60+1.0076] Z-.505
G02 X.8112 Y[#60+.61] I-.1227 J-1.0076
G01 X.567
G02 X.2448 Y[#60+.796] I0. J.372
G01 X.1227 Y[#60+1.0076]
X-.0939 Y[#60+.8826]
X-.2493 Y[#60+1.1519]
G02 X-.2035 Y[#60+1.2485] I.0563 J.0325
X1.183 Y[#60+.448] I.2035 J-1.2485
X1.1222 Y[#60+.36] I-.0608 J-.023
G01 X.567
G02 X.0283 Y[#60+.671] I0. J.622
G01 X-.0939 Y[#60+.8826]
G00 Z.1
#60=[#60+5.]
M99 ( SUBPROGRAM RETURN)

O65 (SUBPROGRAM OF O100)
G01 Z0. F70.
X1.1222 Y[#65+-.36 Z-.0022
X.8112 Z-.0571
Y[#65+-.61 Z-.1011
X.567 Z-.1442
X.5345 Y[#65+-.6114] Z-.1499
X.5024 Y[#65+-.6157] Z-.1557
X.4707 Y[#65+-.6227] Z-.1614
X.4397 Y[#65+-.6324] Z-.1671
X.4097 Y[#65+-.6449] Z-.1728
X.381 Y[#65+-.6598] Z-.1785
X.3536 Y[#65+-.6773] Z-.1843
X.3278 Y[#65+-.697] Z-.19
X.3039 Y[#65+-.719] Z-.1957
X.282 Y[#65+-.7429] Z-.2014
X.2622 Y[#65+-.7686] Z-.2072
X.2448 Y[#65+-.796] Z-.2129
X.1227 Y[#65+-1.0076] Z-.256
X.1765 Y[#65+-.9995] Z-.2656
X.2299 Y[#65+-.9886] Z-.2752
X.2826 Y[#65+-.9749] Z-.2848
X.3345 Y[#65+-.9583] Z-.2944
X.3854 Y[#65+-.939] Z-.304
X.4352 Y[#65+-.917] Z-.3136
X.4837 Y[#65+-.8923] Z-.3232
X.5309 Y[#65+-.8651] Z-.3328
X.5765 Y[#65+-.8354] Z-.3424
X.6205 Y[#65+-.8032] Z-.352
X.6627 Y[#65+-.7688] Z-.3616
X.703 Y[#65+-.7321] Z-.3712
X.7412 Y[#65+-.6934] Z-.3808
X.7774 Y[#65+-.6526] Z-.3904
X.8112 Y[#65+-.61] Z-.4
G02 X.1227 Y[#65+-1.0076] I-.8112 J.61
G01 X.2448 Y[#65+-.796]
G02 X.567 Y[#65+-.61] I.3222 J-.186
G01 X.8112
Y[#65+-.36]
X1.1222
G02 X1.183 Y[#65+-.448] I0. J-.065
X-.2035 Y[#65+-1.2485] I-1.183 J.448
X-.2493 Y[#65+-1.1519] I.0105 J.0642
G01 X.0283 Y[#65+-.671]
G02 X.567 Y[#65+-.36] I.5387 J-.311
G01 X.8112
G00 Z.1
X.3379 Y[#65+-.9571]
Z-.3
G01 Z-.4 F70.
X.3884 Y[#65+-.9377] Z-.4096
X.4379 Y[#65+-.9157] Z-.4191
X.4861 Y[#65+-.891] Z-.4286
X.5329 Y[#65+-.8639] Z-.4382
X.5782 Y[#65+-.8342] Z-.4477
X.6218 Y[#65+-.8022] Z-.4573
X.6637 Y[#65+-.7679] Z-.4668
X.7037 Y[#65+-.7315] Z-.4764
X.7417 Y[#65+-.6929] Z-.4859
X.7776 Y[#65+-.6524] Z-.4955
X.8112 Y[#65+-.61] Z-.505
G02 X.1227 Y[#65+-1.0076] I-.8112 J.61
G01 X.2448 Y[#65+-.796]
G02 X.567 Y[#65+-.61] I.3222 J-.186
G01 X.8112
Y[#65+-.36]
X1.1222
G02 X1.183 Y[#65+-.448] I0. J-.065
X-.2035 Y[#65+-1.2485] I-1.183 J.448
X-.2493 Y[#65+-1.1519] I.0105 J.0642
G01 X.0283 Y[#65+-.671]
G02 X.567 Y[#65+-.36] I.5387 J-.311
G01 X.8112
G00 Z.1
#65=[#65+5.]
M99 ( SUBPROGRAM RETURN)

O100 (SUBPROGRAM OF O100)
G01 Z-.19 F70.
G03 X-.3027 Y[#100+-2.1538] I.3027 J-2.1538
G00 Z.1
Y[#100+2.1538]
Z-.09
G01 Z-.38 F70.
G03 X-.3027 Y[#100+-2.1538] I.3027 J-2.1538
G00 Z.1
Y[#100+2.1538]
Z-.28
G01 Z-.57 F70.
G03 X-.3027 Y[#100+-2.1538] I.3027 J-2.1538
G00 Z.1
Y[#100+2.1538]
Z-.47
G01 Z-.76 F70.
G03 X-.3027 Y[#100+-2.1538] I.3027 J-2.1538
#100=[#100+5.]
M99 ( SUBPROGRAM RETURN)

O105 (SUBPROGRAM OF O100)
G01 Z-.19 F70.
G03 X.3027 Y[#105+2.1538] I-.3027 J2.1538
G00 Z.1
Y[#105+-2.1538]
Z-.09
G01 Z-.38 F70.
G03 X.3027 Y[#105+2.1538] I-.3027 J2.1538
G00 Z.1
Y[#105+-2.1538]
Z-.28
G01 Z-.57 F70.
G03 X.3027 Y[#105+2.1538] I-.3027 J2.1538
G00 Z.1
Y[#105+-2.1538]
Z-.47
G01 Z-.76 F70.
G03 X.3027 Y[#105+2.1538] I-.3027 J2.1538
#105=[#105+5.]
M99 ( SUBPROGRAM RETURN)

O110 (SUBPROGRAM OF O100)
G01 Z-.76 F70.
G03 X-.2957 Y[#110+-2.1043] I.2957 J-2.1043
#110=[#110+5.]
M99 ( SUBPROGRAM RETURN)

O115 (SUBPROGRAM OF O100)
G01 Z-.76 F70.
G03 X.2957 Y[#115+2.1043] I-.2957 J2.1043
#115=[#115+5.]
M99 ( SUBPROGRAM RETURN)

O120 (SUBPROGRAM OF O100)
G01 Z-.3 F70.
G03 X-.2957 Y[#120+2.1043] I-.2957 J-2.1043
G00 Z.1
X.2957
Z-.2
G01 Z-.6 F70.
G03 X-.2957 Y[#120+2.1043] I-.2957 J-2.1043
#120=[#120+5.]
M99 ( SUBPROGRAM RETURN)

O125 (SUBPROGRAM OF O100)
G01 Z-.3 F70.
G03 X.2957 Y[#125+-2.1043] I.2957 J2.1043
G00 Z.1
X-.2957
Z-.2
G01 Z-.6 F70.
G03 X.2957 Y[#125+-2.1043] I.2957 J2.1043
#125=[#125+5.]
M99 ( SUBPROGRAM RETURN)


( END OF PROGRAM)

N346 M30
%
Re: lost when it comes to nesting
« Reply #6 on: April 29, 2009, 03:08:44 AM »
Radius to end of arc differs from radius to startLine

Google shows you're not the first person stumped by this.
What it is, nobody seems to know, but it's NOT related to parameter usage.

Somebody said:
"Mine ("general config" Abs/Inc curves button) was set to Absolute, I set it to Inc and now mach3 is fine with those radius cuts"
Although, G91.1 should have put it into Incremental IJK mode regardless.  I don't understand.  But it's not a parameter-related thing.

You may feel some pain at the lack of "debugging" with parameters.  See you're gonna wonder what's going on but I've yet to figure out how to force a breakpoint on pass 3 and print out the parameter calculation result.  In fact I'm sure there's gotta be a way to display all the parameters but I haven't found it yet.
« Last Edit: April 29, 2009, 05:54:41 AM by MechanoMan »

vmax549

*
Re: lost when it comes to nesting
« Reply #7 on: April 29, 2009, 11:37:43 AM »
Acouple of hints,  In your oriniganl test code you had

G17 G02 X1.9375 Y[#5.] I-1.9375 J0. F 70

THe Y[#5.]   Has a period in there, that is a nono. Also if there is no math function the [] are not required.

I beleive the x[-#5]  works but not a X-[#5]  SO IF you need to move in a neg direction you have to convert the VAR to a neg X[0-#5]

ALSO there is a MACH VAR monitor that will show the values. Look up in the top menu. Open it and assign what VARS you want to see and it displays the values live/realtime as they change.

There is a great deal of math finctions that can be applied(check the mach manual for details).

Just a thought, (;-) TP