Hello Guest it is March 28, 2024, 05:41:15 PM

Author Topic: gcode to mill half ball with cnc mill  (Read 18238 times)

0 Members and 1 Guest are viewing this topic.

gcode to mill half ball with cnc mill
« on: December 09, 2007, 03:52:30 PM »
Hello,  I'd like to make half a ball on my mill, and am trying to figure out the best way.  I don't have any good cam software.

I'd like to just create an arc on the XZ plane and then rotate the coordinates of the XY plane incrimentally by a degree for every cut.  that way I coud just copy the same few lines of code over and over and that would work.  Unfortunately Mach3 wont use  the rotated coordinates in any plane but the XY so that doesn't work.

Any ideas?  Are there any "wizards" out there that do this?  I know a lathe would be ideal for this, but I don't have one with CNC or a large enough ball turner.  Before I've mounted a rotary table on my lathe bed to hold my bit, but I'd like to avoid doing that again and there should be a way to make the cnc mill work anyway.

Thanks!
   Stewart

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: gcode to mill half ball with cnc mill
« Reply #1 on: December 10, 2007, 02:21:05 AM »
How big is this half ball? if not to big you could chuck the stock in the spindle and have a bit of HSS ground  like a lathe tool clamped in the vice and use the Z and X axis to move in an arc. In other words use your mill as a lathe.
Hood

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: gcode to mill half ball with cnc mill
« Reply #2 on: December 10, 2007, 10:45:44 AM »
Hi cameraman

try this - just replace the values of your choice up to "end of inputs" and rock n roll. Please note I knocked this up for you for fun - I haven't actually tested it on my mill so go carefully. Maybe I'll wrap it as a wizard if anyone wants it.

F3000
#1000=100 (hemisphere radius)
#1001=5 (ballmill radius)
#1002=20 (number of steps)
#1005=0 (centre X)
#1006=0 (centre Y)
#1007=150 (safe Z)
(end of inputs)
#1000=110 (total)
#1003=[90.0 / #1002]
#1004=[#1003]
G00 Z[#1007]
M98 P1 L[#1002]
M30
O1
#1008=[#1000 * sin[#1004]]
#1009=[#1008 / tan[#1004]]
g00 X[#1005 + #1008] Y#1006
G01 Z[#1009]
g02 I#1005 J#1006
#1004=[#1004+#1003]
M99
Re: gcode to mill half ball with cnc mill
« Reply #3 on: December 10, 2007, 10:58:25 AM »
Thanks!  I'll try the code and let you know.  My half ball is 100mm in diameter, although i'm working in inches so it is 3.937", if it was smaller chucking the material in the spindle might have worked.
Re: gcode to mill half ball with cnc mill
« Reply #4 on: December 10, 2007, 11:03:29 AM »
I don't know if you'll make the wizard or not (I definately could use it), but if you do in this application my half ball is only the lower part of the ball, so it will look like a half ball with the top lopped off, so it wouldn't need to start from the top.

thanks again.

stewart

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: gcode to mill half ball with cnc mill
« Reply #5 on: December 10, 2007, 11:51:21 AM »
erm - slight error. replace the line
 #1000=110 (total)
with
 #1000=[#1000 + #1001] (total)

I had it fixed radius but it needs the sum of the hemisphere and ballmill radius.

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: gcode to mill half ball with cnc mill
« Reply #6 on: December 10, 2007, 12:04:45 PM »
If your rotary table has a motor on it, then mount the work on the rotary table and turn that after each pass.

Yes - it is possible to make a mill do it, but surely you are making an easy job more difficult by using the wrong machine.
Surely, unless you use a very small cutter, or a shaped one, the machining will show.
Not me driving the engine - I'm better looking.
Re: gcode to mill half ball with cnc mill
« Reply #7 on: December 10, 2007, 12:05:38 PM »
Cool.  I had taken that line out since it didn't seem right, thanks for the fix!  I also  changed G01 Z[#1009] to G01 Z[#1009 - #1000] so that it starts at the surface of the material and mills down (negatively).  This is my first venture into any gcode scripting, thanks for helping and opening my eyes to this stuff.  Now i'm trying to figure out how to make the program jump to the start z point so I don't waste cycles milling air the first half of the hemisphere.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: gcode to mill half ball with cnc mill
« Reply #8 on: December 10, 2007, 12:13:40 PM »
hint: #1003 holds the definition of the first circle (90 degrees / number of steps).
Re: gcode to mill half ball with cnc mill
« Reply #9 on: December 10, 2007, 12:16:00 PM »
Yes, the mill isn't the perfect machine for making round cuts, but there are a lot of other cuts involved that require the mill and the time to chuck up the part in the lathe, setup the tools, and manually turn it isn't worth it in this particular case.  I've milled round cones before with great results, with a 1/2" ball endmill I was really surprised in the quality of the taper, after a light bead blasting you'd never know it wasn't a lathe.  I just haven't done a hemisphere before, it seems the quality should be the same results as a cone, but with sin and cos introduced.  I don't have a motorized rotary table.

I'll let you know the results when i'm done, still working on the code with much help from Stirling, i'm curious too.