Author Topic: Spiral Help  (Read 8339 times)

Offline Markus

  • Ewok
  • *
  • Posts: 4
    • View Profile
Spiral Help
« on: June 05, 2014, 14:45:21 pm »
I need to mill a sloping spiral jig out of Delrin.  The largest diameter of the spiral is 40mm, with the smallest diameter 10mm.  The center (10mm) is the highest.  Each revolution needs to drop 2mm, 8mm total as there are 4 revolutions.  Each spiral loop increases in diamete about 10mm.  I have created a DXF file.  I would like to cut center line.  I am having a problem creating the slope in CB.  Any help will be apprecited.  Thanks,

Regards,
Markus

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3355
    • View Profile
Re: Spiral Help
« Reply #1 on: June 05, 2014, 17:05:59 pm »
I have created a DXF file
================

Post the file here and somebody will help you.
My 2ยข

Win11, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, 4th Axis, Endurance Laser.

Offline Markus

  • Ewok
  • *
  • Posts: 4
    • View Profile
Re: Spiral Help
« Reply #2 on: June 05, 2014, 20:15:05 pm »
Thanks,  here is the DXF.
Regards,
Markus

Offline macbob

  • Storm Trooper
  • ***
  • Posts: 189
    • View Profile
    • Bob Mackay
Re: Spiral Help
« Reply #3 on: June 05, 2014, 23:24:31 pm »
I believe that you want to subtract from the z coordinate an amount proportional to each point's distance from the origin, i.e Pz = Pz - sqrt (x**2 + y**2) * n.

I have convinced myself that this cannot be done by use of the CamBam transformation matrix, although I may be wrong.

Sorry not to be more help!

Bob

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8969
    • View Profile
Re: Spiral Help
« Reply #4 on: June 05, 2014, 23:36:19 pm »
Bob,
I think you're right, but I also think it would be easy to create a conical surface in another CAD, then import that, and project a plain spiral onto it.

But then, I'm not a 3D guru.  <G>

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8969
    • View Profile
Re: Spiral Help
« Reply #5 on: June 06, 2014, 00:39:52 am »
Ok...
If anyone wants to clean this up, it will work.  I just cannot take the time, so I spent 5 minutes and touched up Andy's old "boingy" script to make a spiral helix.(I have been corrected, and it's a "conic helix")

Fix up the increments and the step size, and it would make a custom conic helix of any kind.

LLoyd  (updated version with user inputs in subsequent reply below)


here:
'//////////////////////////////////////////////////////////////////////////////
'
' Conic Helix.vbs
' CamBam vbscript
' With credits to 10 Bulls for the idea from "Boingy"
'
sub main
   dim p as polyline =   MakeConicHelix()
   doc.add(p)
end sub




function  MakeConicHelix as polyline
   dim start as single   = 0         ' in radians
   dim finish as single = 30*pi      ' in radians
   dim steps as single   = 500      ' number of steps
   dim radius as single = 0
   dim startz as single = 20
   dim endz as single   = 0
   dim radius_step as single = .05

   dim x as single = 0
   dim y as single = 0
   dim z as single = startz

   dim th as single = start
   dim dt as single = (finish-start)/steps
   dim dz as single = (endz-startz)/steps

   '// Get the drawing ready to draw   
   dim p as Polyline = new Polyline

   '// Play da loop
   for i as short = 0 to steps
      z = z + dz
      th = th + dt
      x = radius * math.cos(th)
      y = radius * math.sin(th)
      radius=radius+radius_step


      p.Add(x,y,z)
   next i

   MakeConicHelix = p
      
end function

« Last Edit: June 06, 2014, 13:11:27 pm by lloydsp »
"Pyro for Fun and Profit for More Than Fifty Years"

Offline Garyhlucas

  • CNC Jedi
  • *****
  • Posts: 1463
    • View Profile
Re: Spiral Help
« Reply #6 on: June 06, 2014, 00:47:09 am »
Lloyd,
I love how you kick this stuff out. If the OP can produce a Cone surface in his cad program he can project the spiral on to it. I just did a 60" radius on the face of a 13-1/2" diameter pipe flange so it would fit against the side of a 120" diameter plastic tank using a spiral projected onto a surface arc extruded in CamBam.  Then cut it using engrave MOP. Works great!
Gary H. Lucas

Have you read my blog?
 http://a-little-business.blogspot.com/

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8969
    • View Profile
Re: Spiral Help
« Reply #7 on: June 06, 2014, 01:11:24 am »
Gary, thanks.

This little script just needs inputs for the parameters and some testing.  It will generate a conic helix right in CB without any external CAD.

With only a few more "touchups", it could also follow any polyline and make it descend in Z according to MacBob's formula, or any other formula or scheme you'd like to name -- all inside CB.

Lloyd
« Last Edit: June 06, 2014, 11:57:50 am by lloydsp »
"Pyro for Fun and Profit for More Than Fifty Years"

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8969
    • View Profile
Re: Spiral Help
« Reply #8 on: June 06, 2014, 13:07:49 pm »
Sorry... nobody should just drop a bomb and say "here, fix it".  I got a few moments early this AM to touch it up a little.

This now works with user input.  There are NO protections against bad inputs.  I didn't have that much time. <G>

LLoyd

'//////////////////////////////////////////////////////////////////////////////
'
' Conic Helix.vbs
' CamBam vbscript
' With credits to 10 Bulls for the idea from "Boingy"
'
   dim turns as single
   dim start_diameter as single
   dim end_diameter as single
   dim depth_increment as single
   dim strAnswer as string
   dim direction as single
sub main
   start_diameter=val(Inputbox ("Smaller diameter? "))
   end_diameter=val(Inputbox ("Larger diameter? "))
   turns=val(Inputbox("Number of turns? "))
   depth_increment=val(Inputbox ("Depth change per turn -- negative =-Z, or down "))
   direction=val(Inputbox("Direction to turn -- -1=CCW, 1=CW"))
   direction=direction*-1
   dim p as polyline =   MakeConicHelix()
   doc.add(p)
end sub




function  MakeConicHelix as polyline
   dim start as single   = 0         ' in radians
   dim finish as single = turns*2*pi   '30*pi      ' in radians
   dim steps as single   = 500      ' number of steps
   dim radius as single = start_diameter/2
   dim startz as single = -1*depth_increment*turns
   dim endz as single   = 0
   
   dim radius_step as single = (end_diameter-start_diameter)/(steps*2)
   


   dim x as single = 0
   dim y as single = 0
   dim z as single = startz

   dim th as single = start
   dim dt as single = (finish-start)/steps*direction
   dim dz as single = (endz-startz)/steps

   '// Get the drawing ready to draw   
   dim p as Polyline = new Polyline

   '// Play da loop
   for i as short = 0 to steps
      x = radius * math.cos(th)
      y = radius * math.sin(th)
      p.Add(x,y,z)

      radius=radius+radius_step
      z = z + dz
      th = th + dt


   next i

   MakeConicHelix = p
      
end function
« Last Edit: June 06, 2014, 14:33:25 pm by lloydsp »
"Pyro for Fun and Profit for More Than Fifty Years"

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8969
    • View Profile
Re: Spiral Help
« Reply #9 on: June 06, 2014, 13:44:41 pm »
It slightly over-steps the very last increment, so if you ask for an integral number of turns, it goes slightly past that.  I'll look at it tonight or tomorrow.

Ah... the start point isn't the 'start point', it's the first step in.  I'll fix that.

(NB... fixed... above.  If you've downloaded it before, snag it again.)

Lloyd
« Last Edit: June 06, 2014, 14:34:06 pm by lloydsp »
"Pyro for Fun and Profit for More Than Fifty Years"