603,767 active members*
3,061 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 25
  1. #1
    Join Date
    Feb 2006
    Posts
    340

    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  

  2. #2
    Join Date
    Feb 2006
    Posts
    992
    nice work!!!!!!!
    The best way to learn is trial error.

  3. #3
    Join Date
    Feb 2006
    Posts
    1792
    The cube appears to have been machined from five sides, after suitably tilting it everytime. How did you ensure accuracy in positioning, so that the workpiece zero point does not shift. The starting cube may not have been a perfect cube.

    I also have machined a half-sphere, but used a CAM software to generate the toolpath.

  4. #4
    Join Date
    Jan 2006
    Posts
    4396
    This is one of the best things about being a machinist. We can make what ever we can imagine.

    Great job on this dpuch!!!!!
    Toby D.
    "Imagination and Memory are but one thing, but for divers considerations have divers names"
    Schwarzwald

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

    www.refractotech.com

  5. #5
    Join Date
    Nov 2005
    Posts
    1468
    Oh, I am sooo gonna make one of them. That is awesome!
    I love deadlines- I like the whooshing sound they make as they fly by.

  6. #6
    Join Date
    May 2005
    Posts
    1662
    Quote Originally Posted by dpuch View Post
    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.
    How would you approach the 6th side if cutting another one ?

    Very cool btw
    Anyone who says "It only goes together one way" has no imagination.

  7. #7
    Join Date
    May 2007
    Posts
    781
    Quote Originally Posted by cyclestart View Post
    How would you approach the 6th side if cutting another one ?

    Very cool btw
    There are some metal alloys available from MSC, Travers, etc. which melt at low temps, less then boiling water. And when the freeze they expand a very little bit.
    So freeze the part in some of that, machine it, then melt it to get the parts.

  8. #8
    Join Date
    Jul 2003
    Posts
    1766
    That is just awesome. I wrote that program initally to test the owords in emc2. I never acutally finished one to see if it actually worked.

    Nice work!

    sam
    Attached Thumbnails Attached Thumbnails woodcube.jpg   axisubuntu.jpg  

  9. #9
    Join Date
    Jul 2003
    Posts
    1766
    re: holding for the last cut..

    I was always going to machine a negative of the ball and cage and put it in a vise. The negative would hold the ball and cage well enough to finish the last side. (that was my hope anyways)

    sam

  10. #10
    Join Date
    Nov 2005
    Posts
    1468
    I've seen stuff like this b4 (but it was a lose cube) and they used wax to hold the last face.
    I love deadlines- I like the whooshing sound they make as they fly by.

  11. #11
    Join Date
    Feb 2006
    Posts
    340
    Thanks everyone for the comments.

    Quote Originally Posted by sinha_nsit View Post
    How did you ensure accuracy in positioning, so that the workpiece zero point does not shift.
    Nothing special, I did start out with a cube I machined to about ±0.002" within square. I just used a fixed stop in a vice to relocate the block as I rotated it. As this was a first try I didn't really worry about trying to get really tight tolerances or fine finish.

    Quote Originally Posted by cyclestart View Post
    How would you approach the 6th side if cutting another one?
    Anders comment below is exactly what I was thinking of. The way the program is written you can have VERY small squares of material left on the 6 sides of the ball. I had a minor hope that clamping tight enough on these (flexing in the cage) and reducing the feed rate to about 10% would be enough. But the ball rotates too easily on such small contact points. I think it might work if it a clamp was put on 90° to keep it from rotating.

    Quote Originally Posted by Andre' B View Post
    There are some metal alloys available from MSC, Travers, etc. which melt at low temps, less then boiling water. And when the freeze they expand a very little bit.
    So freeze the part in some of that, machine it, then melt it to get the parts.
    Yep, CeroBEND or CeroSAFE or similar.

    Quote Originally Posted by samco View Post
    That is just awesome. I wrote that program initally to test the owords in emc2. I never acutally finished one to see if it actually worked.
    Great to have your input! Yep the math and code worked well. Like I said, I did have to change the o code loop logic to fanuc IF GOTO but otherwise the original ran fine as well. Most of the other changes were just to add the roughing passes capability. Oh, and one other to make sure the last pass left the right bar size regardless of the step over.

    If I get a chance to run another soon I'll take some more pictures of it in progress.

  12. #12
    Join Date
    Oct 2009
    Posts
    5
    Great job --- Nice

  13. #13
    Join Date
    Aug 2007
    Posts
    558

    Quote Originally Posted by ImanCarrot View Post
    I've seen stuff like this b4 (but it was a lose cube) and they used wax to hold the last face.
    Like this stuff?

    Regards,

    Jason

  14. #14
    Join Date
    Feb 2006
    Posts
    340

    Some more error checks.

    Some calculation checks so it will let you know if you will not cleanup the sphere where it is closest to the rails. It errors if the angle between the last cuts on two adjacent faces are more than the step over angle. #16 provides a way to over ride the error and cut anyhow.

    Code:
    #16=0 (SET TO 1 TO OVERRIDE THE FULL MACHINING CHECK)
    
    (CHECK TO SEE IF FULL BALL WILL BE FORMED)
    IF [#1/2-#2-#3] GE SIN[45-#4/2]*#1/2] THEN GOTO 9
    IF #16 EQ 1] THEN GOTO 9
    #3000 = 98 (TOOL OR RAILS ARE TOO LARGE)
    (TOOL OR RAILS ARE TOO LARGE TO FULLY MACHINE SPHERE FOR THIS SIZE CUBE)
    (AT MINIMUM STEPOVER KEEP THE RAIL+CUTTER RADIUS UNDER 14.6% OF THE SPHERE-CUBE SIZE)
    (#1*0.146 SHOULD BE GREATER THAN #2+#3)
    (THE PERCENTAGE GROWS AS THE STEPOVER INCREASES FROM ZERO AT 5 DEG STEPOVER IT IS 16.4%))
    
    N0009
    14.6% should always work, and the tool paths should cross each other. With larger finish stepover you an get away with a larger number and keep the finish roughness even.

    Also here are two more pictures of the first part I made. They show a little more detail of the cuts ect.
    Attached Thumbnails Attached Thumbnails DSCN1345.JPG   DSCN1346.JPG  

  15. #15
    That is nice.
    The Fanuc Support Center Team
    www.fanuc-support.com

  16. #16
    Join Date
    Feb 2007
    Posts
    126

    sweet

    That is seriously nice. I wuz thinkin' I was kinda cool learning a bit of macro stuff but THAT is way cool. I'm cutting one now.

    Question, is there anywhere I could get a program to cut just this size, but be efficient and not cut air? In other words, not a macro, a program.

    I'd like to make a few and not have it take a week.

  17. #17
    Join Date
    Feb 2007
    Posts
    126

    done

    Completed one today. For the final face I made pieces to hold the sphere by plunging with a ball end mill, then shimmed the box. The pieces of my set-up are shown in the first pic.

    Not knowing the depth the ball end mill would go to, I did not relieve it and ended up with chamfers in the corners. I'm going to act like I meant to do that.
    Attached Thumbnails Attached Thumbnails MetalWork 001.jpg   MetalWork 010.jpg  

  18. #18
    Join Date
    Sep 2005
    Posts
    69
    Hello
    To hold the ball while machining the last face,put masking tape on four continuous machined faces and pour epoxy glue , to remove put cube in a glass of water and put in a microwave to soften the glue

    Marcel Beaudry

  19. #19
    Join Date
    Feb 2007
    Posts
    126

    final face

    It wasn't that hard to hold. You could use two pieces with chamfers to hold the sphere. Even two square pieces with holes in them. As long as you aren't holding by just the two high points on the sphere. Using a clamp to the end stop would probably work too. If you are holding by only two points it will spin on those points.

    Then you shim the box to hold it solid too.

    Put your "sphere holders" (which need to be identical) on both sides of it and measure the whole mess with calipers. Figure what the shims need to be to make it measure the same at the box and at the sphere. Mill some shims or build them with metal and shim stock.

  20. #20
    Join Date
    Sep 2013
    Posts
    1

    Re: Ball in a cage example

    This is cool. I had tried one using a model I found online, but parametric would be way nicer. Question - has anyone done this same code using loops instead of GOTOs? Essentially an outer loop that steps down the maximum Z depth per pass.

    The system I am using doesn't support GOTO. I could do it in C or other real language, but I am having the devil's own time getting my head around G-Code for some reason.

Page 1 of 2 12

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
  •