Thread: in calculating the tool path
Hybrid View
-
26-07-2010 #1
I am writing a simple hole generator in Processing because I can run it on the Mac and there is very little CAM on the Mac. So I have this generator that will generate G code snippets. However when it comes to the D shaped hole I ave hit a snag. The yellow is the hole I want to draw and the orange is the tool path. The two orange circles represent the limit of the tool path before going horizontal. The question is how do I calculate the position of these holes, given the diameter of the hole can change as can the tool diameter and the depth of the D shape. My maths isn't up to is could someone help please.
Last edited by irving2008; 26-07-2010 at 10:54 PM.
-
26-07-2010 #2
Hi Mike,
Just seen your post, but got to go. Sorry it's Wikipedia, but this might be a starter:
http://en.wikipedia.org/wiki/Circular_segment
Also, the corners will have a radius, not be sharp as per the yellow outline. Sure you knew that . . .
-
26-07-2010 #3
Thanks but that doesn't solve the problem. I know all that maths in the link, that's how I drew the figure I posted in the first place. The problem is when it comes to creating the path at the corners. The tool (circle) has to be tangential to both the curve of the hole and the straight line. Yes the sharpness of the corners will depend on the tool size.
-
26-07-2010 #4
Assuming you have the circle radius and the distance from the circle centre to the line centre you can do it with pythagorus.
X = square root (r squared - centre to centre squared).
Your x coordinates for the line ends are then circle centre x + X, and circle centre x - X
Or have I misunderstood?
-
26-07-2010 #5
Thanks but yes you have misunderstood. It is the center of the tools position I am after when it is at the end of the straight bit. It is where the tool path for the straight bit crosses the tool path for the circular bit. Or put it another way it is the difference in the angle between the center and the bit where the straight joins the curve (which I know as that was part of defining the shape) and the angle between the tool center and the center of the hole. These angles are not the same as I first thought.
-
27-07-2010 #6
Well you just subtract the tool radius from the arc radius and add the tool radius to the line y co-ordinates before you do the pythagorus bit.
I've just been writing code to do much the same thing, decided pythagorus was a lot easier than applying the cosine rule even if it meant rotating the chord into the vertical and then back again :whistling:
Just to make it interesting I also spiral down into draft angles and hemispherical sections which is taxing my brain a bit but I'm getting there. Slowly. The G-Code is a bit whacky, I define the arc centre using I and J but the end co-ordinates are not necessarily on the same radius as the start. Dubiously G-code legal. I had to mod my mill driving code a bit before it would accept a spiral
-
27-07-2010 #7
Thanks irving, I worked out what I needed this morning on the drive in to work and I agree with you. I just got the sin and cos swapped over but that don't matter it just rotates it through 90 degrees.
It's good to have confirmation before I try and code it. I am using the free language called Processing, it runs on all platforms.
Do you think there would be any interest if I posted the final result? I am also working on a program to send a G code file to the miller. I wanted to use Replicator G but I can't get that to work reliably on my Mac, despite several email exchanges with the authors.
-
27-07-2010 #8
-
27-07-2010 #9
Thanks routercnc, that is in essence what the solution posted by irving actually is, only the equations have been bashed about already to give the solution. The only difference being that instead of using:-
The equation for a circle (x^2 + y^2 = r^2)
then you use the parametric equation for a circle of :-
x = r SIN(theta)
y = r COS(theta)
-
26-07-2010 #10
make the centre of the circle 0,0
call the tool radius t, the radius of the actual hole R and the location of the chord is y = -d
the coordinate of the holes are x = +/- (R-t)sin(arccos((d-t)/(R-t))), y = -d+t
How are you programming this, there may be an easier way
Thread Information
Users Browsing this Thread
There are currently 11 users browsing this thread. (0 members and 11 guests)
Similar Threads
-
Calculating timing belt lengths
By Jonathan in forum Gantry/Router Machines & BuildingReplies: 11Last Post: 10-12-2015, 11:32 AM -
Romi EZ-Path S Lathe crt replacement
By Nemo1966 in forum MonitorsReplies: 5Last Post: 07-10-2013, 04:25 PM -
Calculating Stepper Motor Power? Strength?
By antsals in forum General DiscussionReplies: 2Last Post: 11-07-2011, 12:18 PM -
Calculating torque settings for bolts.
By swarf-boy in forum Machine DiscussionReplies: 2Last Post: 22-12-2010, 12:18 AM -
Calculating forces on linear bearings ...
By Jonathan in forum Rails, Guideways & BearingsReplies: 7Last Post: 24-11-2010, 02:26 AM
Bookmarks