Hello Guest it is March 28, 2024, 01:35:24 PM

Author Topic: Offsets for spherical tools  (Read 11972 times)

0 Members and 1 Guest are viewing this topic.

Offsets for spherical tools
« on: January 20, 2009, 11:36:14 AM »
Hi. Simple question, difficult machining. Can mach3 be set up to allow for a spherical offset system? I need to machine a compound curve - a reflector parabola, in fact - and a spherical or ball-nosed cutter would be the thing to do it. Can a simple offset be used to do this or will I have to wear out  a calculator translating 3D values into real controlled point movements?

Also, pointing me to a section herein on building formulae into G-code would be extremely useful.

Thanks in advance :)

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Offsets for spherical tools
« Reply #1 on: January 20, 2009, 01:37:40 PM »
Use a CAM program and 3D model.

Within the last week, someone (VMAX) posted a macro for doing a sphere on the Yahoo group. If he reads this, maybe he'll post it here.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline Sam

*
  • *
  •  987 987
    • View Profile
    • hillbillyhilton.com
Re: Offsets for spherical tools
« Reply #2 on: January 20, 2009, 05:20:56 PM »
out of curiosity, are you making a telescope?
"CONFIDENCE: it's the feeling you experience before you fully understand the situation."

vmax549

*
Re: Offsets for spherical tools
« Reply #3 on: January 20, 2009, 06:54:48 PM »
OH BOY a challenge, A sphere is fairly simple with parametric programming(yea right) if you like math.

THere several methods,

Let a CAM program do all the work (My favorite)

Program the math into a parametric variable and use the GCODE math to do the work. (Works very well IF you can do the initial math) and my SOns favorite approach(;-)

Use the Mach math channels for the axis's (very little known about how it acutally works).

Let me know if I can help, (;-) TP


PS: a small example of the code to do a  simple sphere. it makes use of sin/cos

o140
   #8 = [[SIN[#5]*#6]*SIN[45]] ( X AND Y POSITION)
   #9 = [0-[[1-COS[#5]]*#6]] (Z HIGHT)
   G1X[#8]Y[#8]F3
   Z[#9]
   G18 G02 X[0-#8]Z[#9]I[0-#8]K[0-[#9+[#6]]]F5
   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]]]
   #5=[#5+#4]

The mach manual has the basics for the parametric coding and all the available math functions
Re: Offsets for spherical tools
« Reply #4 on: January 20, 2009, 08:53:30 PM »
Brilliant, thanks - I'm making microwave reflectors for milimeter wave systems (potentially - it's an ongoing thing). I'll have another go at the manual, i looked ages ago but it was a bit opaque. Perhaps it will be clearer after more coffee. If there's a special coffee I must drink, do let me know ;)
Re: Offsets for spherical tools
« Reply #5 on: January 22, 2009, 12:16:34 PM »
 ??? :o

Just read up on parametric programming. I can see that what I want to do is possible but it's going to need a lot of that very special coffee and a good lie-down afterwards. I will lock the children in the cupboard, unplug the dog and prepare for some very in-depth algebra.
Re: Offsets for spherical tools
« Reply #6 on: January 22, 2009, 03:47:28 PM »
well, that wasn't too hard. Reading the manual, I came up with this.

It's only a demo file to check toolpaths on my laptop, so no units, spindle or anything fancy like that.

Quote
(vague parabola generator)

(SET THE VERTEX POINT OF THE PARABOLA AS 0,0,0)
G0 Y0
G0 Z0
G0 X-30
G0 Y100
#1=-30
M98 P33 L300
M30

O33
G0 Z[0.002*#1*#1]
g2 y-100 i0 j0
G0 Z180
G0 Y100
G0 X#1
#1 = [#1+1]
M99


So it should be a relatively simple matter to integrate some small X and Z offsets by calculating the tangential angle of a line against the profile of the parabola and altering the position of the tool before it does its G2 scan. I think ;)

What strikes me about this is the incredible economy and flexibility of handwritten G-code. The things I've seen spewed out by CAM programs is nobody's business, great reams of g01 here and g01 there, it's a nonsense.

Of course my code above might, in proper CNC terms, be a murderous bag of hacks, do say if so. I can learn. :D
« Last Edit: January 22, 2009, 03:53:07 PM by BluePinnacle »

vmax549

*
Re: Offsets for spherical tools
« Reply #7 on: January 22, 2009, 08:14:33 PM »
NOW you are getting the idea(;-) I have seen 12 lines of  parametric code replace 100,000 lines of normal code. IF you are good with the math there is little that cannot be done.


(;-) TP
Re: Offsets for spherical tools
« Reply #8 on: January 23, 2009, 02:25:56 PM »
Cheers. Happier now. One thing I can't seem to find in the manual is how to apply an axis value off the DRO to a parameter; ie make the value of #3 equal to whatever X is reading at the time. Some clues here?  ???

vmax549

*
Re: Offsets for spherical tools
« Reply #9 on: January 23, 2009, 04:53:12 PM »
Here you have to be sneaky(;-) You would need to write a simple Macro in vb

Say    M9991     Inside the macro would be code like 

Code" #3=" & GetOEMDRO(*********x)          THat would load the value of the DRO into the Variable #3

OR use

Setparam(3),Getoemdro(xx)

OR if you wanted to be able to program the Macro for different Variables or DROs

M9991 P3 Q1202       Then the macro code would be like

SP= Param1()
GD=Param2()
Setparam() &SP, Getoemdro() &GD

That would specify what Varaiable t update and what DRO to use.

Then just call the macro anywhere in the Gcode where it is needed to update the #3 Variable

Hope that helps(;-) TP
« Last Edit: January 23, 2009, 05:10:50 PM by vmax549 »