587,832 active members*
3,431 visitors online*
Register for free
Login
Results 1 to 20 of 25

Threaded View

  1. #1
    Join Date
    Feb 2006
    Posts
    338

    Ball in a cage example

    I was feeling like making something fun, and this looked like it.

    I stole the original code from EMC's wiki but then modified it slightly to run on fanuc controls, and added roughing passes. I only had a stub ball mill, so the roughing lets you specify a max cutter engagement depth for each pass. There are lots more ways to clean it up an add more features.

    Code:
    %
    O0070  (BALL IN CUBE)
    (CENTER TOP OF CUBE IS XYZ ZERO)
    #1=1.5 (SIZE OF BOX AND DIAMETER OF FINISHED BALL)
    #2=0.0625 (BALL MILL CUTTER RADIUS)
    #3=0.125 (SIZE OF BOX BARS)
    #4=5.0 (DEGREES OF STEPOVER RESOLUSION AT THE CORNERS)
    #5=#4 (STEPOVER COUNTER)
    #6=[[#1/2]+#2] (ACTUAL CUTTER PATH RADIUS OF SPHERE -- CUTTER RADIUS + RADIUS)
    (#6 ALSO MINIMUM TOOL FLUTES REQUIRED FOR FULL SPHERE)
    #7=5.0 (FEED RATE)
    #10=2.0 ( > 1 EQUALS A ROUGH PASS AT #10*#4 STEPOVER)
    IF [#10 LT 1.0] THEN #10=1.0 (SAFTEY CHECK - KEEP #10 >= 1.0)
    #11=0.05 (ROUGH PASS MATERIAL TO LEAVE IN Z)
    #12=0.17 (MAX Z DEPTH PER ROUGH PASS)
    #13=FUP[[#6-#11]/#12] (ROUGH PASSES TO TAKE)
    #14=[#6-#11]/#13 (Z PER ROUGH PASS)
    #15=#11+#14*#13 (SET ROUGHPASS Z OFFSET)
    
    G90 G57 G0 X0 Y0 M3 S4000
    (G43 Z1.0 H1)
    Z0.1
    
    N0010
       IF [#10 LE 1.0] THEN #15=0 (FINISH Z LEVEL)
       #8 = [[SIN[#5*#10]*#6]*SIN[45]] ( X AND Y ARC START POSISION)
       #9 = [0-[[1-COS[#5*#10]]*#6]]+#15 (ARC Z START HIGHT)
       IF [#8 LT [#1/2-#2-#3]] GOTO 20
       #8 = [#1/2-#2-#3]  (SET LAST PASS AT FINISHED BAR SIZE)
       #9 = 0-[#6 - SQRT[#6*#6 - [#8*#8+#8*#8]]]+#15
       N0020
       IF [#9 GT 0] GOTO 15 (WOULD ONLY CUT AIR, STILL ABOVE Z0)
       G1X[#8]Y[#8] F#7
       Z[#9] F[#7/3]
       G18 G02 X[0-#8]Z[#9]I[0-#8]K[0-[#9+[#6]]] F[#7]
       G19 G03 Y[0-#8]Z[#9]J[0-#8]K[0-[#9+[#6]]]
       G18 G03 X[#8]Z[#9]I[#8]K[0-[#9+[#6]]]
       G19 G02 Y[#8]Z[#9]J[#8]K[0-[#9+[#6]]]
       N0015
       #5=[#5+#4]
    IF [#8 LT [#1/2-#2-#3]] GOTO 10
    
    #5=#4 (RESET STEPOVER COUNTER FOR NEXT ROUGH-FINISH PASS) 
    G0 Z0.1 
    X0 Y0
    
    IF [#10 LE 1.0] GOTO 9000 (DONE)
    #13=#13-1.0 (STEP DOWN Z RIOUGHING PASS)
    IF [#13 LT 0] GOTO 100 (ROUGHING DONE)
    #15=#11+#14*#13 (STARTING ROUGHPASS Z OFFSET)
    GOTO 10
    N0100
    #10=1.0
    GOTO 10
    
    N9000
    G0 Z1.0
    M9
    M5
    M30
    %
    I made the mistake of trying to cut the 6th side while just grabbing the sides of the ball :/ It is cut free at least, just not a full sphere.
    Attached Thumbnails Attached Thumbnails DSCN1344.jpg  

Similar Threads

  1. Centurion 6 Card Cage Mess
    By bwilkinson in forum Milltronics
    Replies: 12
    Last Post: 03-04-2014, 04:09 PM
  2. Need to build a small aluminum cage
    By bobk544 in forum Welding Brazing Soldering Sealing
    Replies: 2
    Last Post: 08-22-2011, 05:00 PM
  3. KM3P Card Cage bottom wires
    By kc8jyr in forum HURCO
    Replies: 4
    Last Post: 07-08-2011, 02:14 PM
  4. KM3P Card Cage wires
    By winds1sj in forum HURCO
    Replies: 1
    Last Post: 07-06-2011, 02:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •