User Tools

Site Tools


Sidebar

Home



Knowledge Base


Guides & Tutorials

Projects

Samples

  G-Code
   Square
   Arcs
   Mickey
   Arrow
   Bear
   Ball In Cage

  Dialogs
   Square
   Rounded Square
   Guess The Number

  O-Words
   Polygon

  Subprocedures
   Lissajous

   Lissajous (sub..endsub..call)
   Lissajous (call..sub..endsub)

   Lissajous (exec..O..M99)

   Lissajous (G65)
   Lissajous (G65 with GOTO)

   Palindrome
   PrimeFactors
   Fibonacci

  Splines
   Butterfly

  G06
   arrchr

  Dynamic
   Clock
   DateTime


kb:samples:ball_in_cage

Ball In Cage

G21 G90 G91.1
#<size> = 30 (size of box)
#<tool> = 1.5 (tool radius)
#<edge> = 2 (size of box edge)
#<res> = 5 (resolution)
#<cnt> = #<res> (counter)
#<rad> = [[#<size>/2]+#<tool>] (radius of circle = tool radius + bos size) 
G00 X0 Y0 Z5
o140 do 
   #<xy> = [[SIN[#<cnt>]*#<rad>]*SIN[45]] ( X and Y position)
   #<z> = [0-[[1-COS[#<cnt>]]*#<rad>]] (Z height)
   G01 X[#<xy>] Y[#<xy>] 
   G01 Z[#<z>]
   G18 G02 X[0-#<xy>] Z[#<z>] I[0-#<xy>] K[0-[#<z>+[#<rad>]]]
   G19 G03 Y[0-#<xy>] Z[#<z>] J[0-#<xy>] K[0-[#<z>+[#<rad>]]]
   G18 G03 X[#<xy>] Z[#<z>] I[#<xy>] K[0-[#<z>+[#<rad>]]]
   G19 G02 Y[#<xy>] Z[#<z>] J[#<xy>] K[0-[#<z>+[#<rad>]]]
   #<cnt> = [#<cnt>+#<res>]
o140 while [#<xy> LT [#<size>/2-#<tool>-#<edge>]]
G00 Z5
G00 X0 Y0
M2
kb/samples/ball_in_cage.txt · Last modified: 2024/04/02 22:08 by 127.0.0.1

Page Tools