repeat only making 2 instances of parts

More
10 years 6 months ago #72588 by burdickjp
I'm having trouble getting this repeat cycle to do more than 2 instances of the part. Any suggestions?
Code:
(tableClamps) (program cuts in quadrant I) #<countparts> = 3 ;how many parts to do #<spaceparts> = 8 ;distance between repititions of the parts #<zstep> = 1 ;distance to feed in z for every pass around #<positionslot> = 9 #<heightslot> = 7.5 #<depthslot> = 5.5 #<diameterclearance> = 10.5 #<diametercounterbore> = 16.0 #<widthclamp> = 19 #<lengthclamp> = [#<positionslot> + #<diameterclearance>/2 + #<diametercounterbore>/2 + #<depthslot>] G21 G90 G00 X0 Y0 Z10.0 G00 X0 Y-8.0 M03 S1200 o100 repeat [#<countparts>] M01 G00 Z0 G41.1 D6 G01 Y0 F300 o200 while [#<_z> GT [-#<widthclamp> + #<zstep>]] G91 G01 Z-#<zstep> G01 Y[#<heightslot> + #<positionslot>] G02 X#<positionslot> Y0 I[#<positionslot>/2] J0 G03 X#<positionslot> Y-#<positionslot> I#<positionslot> J0 G01 X[#<lengthclamp> - #<positionslot> *2] G01 Y-#<heightslot> G01 X-[#<lengthclamp>] o200 endwhile G90 G40 G00 Y-8.0 G00 Z1.0 G00 X[#<lengthclamp> + #<spaceparts>] o100 endrepeat M30 %

Please Log in to join the conversation.

More
10 years 6 months ago #72589 by BigJohnT
It's because your not updating the X position, it will cut all past the first one in the second location. Save the current X then add the offset.

JT

Please Log in to join the conversation.

More
10 years 6 months ago #72590 by burdickjp
I see it! Thank you!

Please Log in to join the conversation.

More
10 years 6 months ago #72594 by burdickjp
Here it is, corrected.
Code:
(tableClamps) (program cuts in quadrant I) #<countparts> = 3 ;how many parts to do #<spaceparts> = 8 ;distance between repititions of the parts #<zstep> = 1 ;distance to feed in z for every pass around #<positionslot> = 9 #<heightslot> = 7.5 #<depthslot> = 5.5 #<diameterclearance> = 10.5 #<diametercounterbore> = 16.0 #<widthclamp> = 19 #<lengthclamp> = [#<positionslot> + #<diameterclearance>/2 + #<diametercounterbore>/2 + #<depthslot>] G21 G90 G00 X0 Y0 Z10.0 G00 X0 Y-8.0 M03 S1200 o100 repeat [#<countparts>] M01 G00 Z0 G41.1 D6 G01 Y0 F300 o200 while [#<_z> GT [-#<widthclamp> + #<zstep>]] G91 G01 Z-#<zstep> G01 Y[#<heightslot> + #<positionslot>] G02 X#<positionslot> Y0 I[#<positionslot>/2] J0 G03 X#<positionslot> Y-#<positionslot> I#<positionslot> J0 G01 X[#<lengthclamp> - #<positionslot> *2] G01 Y-#<heightslot> G01 X-[#<lengthclamp>] o200 endwhile G90 G40 G00 Y-8.0 G00 Z1.0 G00 X[#<_x> + #<lengthclamp> + #<spaceparts>] o100 endrepeat M30 %

Please Log in to join the conversation.

Time to create page: 0.081 seconds
Powered by Kunena Forum