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

0 Members and 1 Guest are viewing this topic.

Offline cameraman

  • Active Member
  • Posts: 18
    • View Profile
Re: gcode to mill half ball with cnc mill
« Reply #10 on: December 10, 2007, 07:06:50 PM »
Got it done, thanks for help!  Here is the part... [img http://www.kickasscamera.com/cad/100mmballadapter.jpg]http://[/img]  You may see a line on there that shouldn't be, its from a slightly off roughing pass from a previous attempt, not from this code.

It is an adapter plate for a 100mm bowl tripod, the curve of the part fits into a matching bowl so you can adjust its level easy.  My g code is kind of messy, but i'll post it here anyway in case someone ever searches for something similar.

Thanks.


#1080=.125  (safe z height)
#1081=2     (plung feedrate)
#1082=15    (feedrate)
#1060=.795  (z correction from top of ball to cropped starting point)

#1001=.25   (ballmill radius)

#1000=2.125  (hemisphere radius ROUGH pass)
#1050=1.9685 (hemisphere radius FINiSH pass)

#1002=20 (number of steps ROUGH pass)
#1052=80 (number of steps FINiSH pass)

#1070= 11 (number of ROUGH steps to skip)
#1071= 44 (number of FINiSH steps to skip)

#1005=0 (centre X)
#1006=0 (centre Y)

% end of user entered variables

#1000=[#1000 + #1001] (total)
#1003=[90.0 / #1002]
#1004=[#1003]
#1053=[0 - #1050 - #1001] (the z offset)

G00 Z[#1080]
M98 P1 L[#1070]         (run program)
M98 P2 L[#1002 - #1070] (run program)

G00 Z[#1080]

#1000=[#1050]
#1002=[#1052]

#1000=[#1000 + #1001] (total)
#1003=[90.0 / #1002]
#1004=[#1003]
#1053=[0 - #1000] (the z offset)

M98 P1 L[#1071]         (run program)
M98 P2 L[#1002 - #1071] (run program)
G00 Z[#1080]
M30

O1
  #1008=[#1000 * sin[#1004]]
  #1009=[#1008 / tan[#1004]]
  #1004=[#1004+#1003]
M99

O2
  #1008=[#1000 * sin[#1004]]
  #1009=[#1008 / tan[#1004]]
  g00 X[#1005 + #1008] Y#1006
  F[#1081]
  G01 Z[#1009 + #1053 +#1060]
  F[#1082]
  g03 I#1005 J#1006
  #1004=[#1004+#1003]
M99
M0

Offline cameraman

  • Active Member
  • Posts: 18
    • View Profile
Re: gcode to mill half ball with cnc mill
« Reply #11 on: December 10, 2007, 07:10:08 PM »
One more note.  This code (the good parts anyway) are all thanks to sterling.  If anyone else finds it useful they should let him know.

Offline stirling

  • Global Moderator
  • *
  • Posts: 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: gcode to mill half ball with cnc mill
« Reply #12 on: December 11, 2007, 11:53:04 AM »
nice one cameraman - good job - and thanks for the credit - much appreciated  :)

Offline Kabol

  • Active Member
  • Posts: 8
    • View Profile
Re: gcode to mill half ball with cnc mill
« Reply #13 on: December 19, 2007, 04:59:08 PM »
I’ve been watching this thread on and off for a few days and I wish to thank both Stirling & Cameraman for a very informative thread. I’m just learning CNC so this project was a huge help to me.

Kabol

Offline Overloaded

  • Global Moderator
  • *
  • Posts: 4,783
    • View Profile
Re: gcode to mill half ball with cnc mill
« Reply #14 on: December 19, 2007, 05:08:19 PM »
DITTOS ! !
I saved this one as well.
Best darned forum I've ever seen !

Offline NeilD

  • Active Member
  • Posts: 4
    • View Profile
Re: gcode to mill half ball with cnc mill
« Reply #15 on: October 27, 2014, 11:18:07 AM »
Just one question, do I type in all the code and parameters as is just adding my numbers in? I'm a newbie myself and really need to mill a hemisherical pocket. Thanks in advance!

Offline stirling

  • Global Moderator
  • *
  • Posts: 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: gcode to mill half ball with cnc mill
« Reply #16 on: October 28, 2014, 07:35:34 AM »
I can't remember what I did last week - never mind 7 years ago  ;) but from a quick look - yes - the comments in the code should tell you which values to change for your particular hemisphere.