CAD CAM EDM DRO - Yahoo Group Archive

RE: [CAD_CAM_EDM_DRO] hi -- Algorithm for Position in a Circle.

Posted by Hire, Ejay
on 2001-10-11 08:11:03 UTC
Here's a thought or two..

Equation for a Circle: x^2 + y^2 = r^2
Variables:
Xc (Current Position of Cutting tool in X axis)
Yc (Current Position of Cutting tool in Y axis)
R Radius (Constant)
Xmin (Smallest "Step" size in the X axis)
Ymin (Smallest "Step" size in the Y axis)
Xnext = (Next Absolute position on the X axis)
Ynext = (Next Absolute position on the Y axis)


First, Solve the equation for y..
y = SQRRoot((x-r)*(x+r))
Then...

Do Until Ynext > Yc + Ymin
Xnext = Xnext + Xmin
Ynext = SqrRoot((Xnext - r) * (Xnext + R))
Loop

This would only work for Constantly Increasing Values of X an Y. To Make it
work in the other three quadrants will require a better math person than I.





-----Original Message-----
From: Drew Rogge [mailto:drew@...]
Sent: Thursday, October 11, 2001 10:16 AM
To: CAD_CAM_EDM_DRO@yahoogroups.com
Subject: Re: [CAD_CAM_EDM_DRO] hi


Semih,

I'm not sure what CNC controllers use for circle generation but
you might try doing a web search on Bresenham's circle drawing
algorithm. This used a lot in computer graphics. You'll probably
also find that you may need more input than just x1,y1 and x2,y2.
Even if these points are the beginning and end of a quarter segment
of a circle, there are two circles which share those points; one
whose center is at x1,y2 and the other at x2,y1. This is one
of the reasons g-codes allow you to specify if the travel along
the circle is in the clockwise or counter clockwise direction.

Drew

sdiken@... wrote:
>
> My project is "Conversion of a conventional lathe to the CNC lathe,
> by using PC based motion control unit" The programming language is
> Turbo Pascal. PC is sending signals to parallel port. Then a driver
> is sending this signals to 2 step motors. One of them is acting on X-
> direction and the other Y-direction of the lathe. I write a programm.
> But is it not finished. In this programm, x1 and y1 (start point)are
> entered and then x2 and y2 (finish point) are entered. If this is a
> linear line, then my programm is successful (y=mx*i) either m>1 or
> m<1 (m=slope). But I can not do it for a circle. (x^2 + y^2 = r^2)
> I want to move the step motors like a quarter circle for example for
> a shaft. Look the figure below. I update the program to the FILES.
> You know any programm like this? Or can please help me!?
>
> _____
> C______
> ______S
> _____C
>
> Thanks
> SEMIH DIKEN
>
--
Drew Rogge
drew@...

Addresses:
FAQ: http://www.ktmarketing.com/faq.html
FILES: http://groups.yahoo.com/group/CAD_CAM_EDM_DRO/files/

Post messages: CAD_CAM_EDM_DRO@yahoogroups.com
Subscribe: CAD_CAM_EDM_DRO-subscribe@yahoogroups.com
Unsubscribe: CAD_CAM_EDM_DRO-unsubscribe@yahoogroups.com
List owner: CAD_CAM_EDM_DRO-owner@yahoogroups.com, wanliker@...
Moderator: jmelson@... timg@... [Moderator]
URL to this page: http://groups.yahoo.com/group/CAD_CAM_EDM_DRO
bill,
List Manager



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

Discussion Thread

Hire, Ejay 2001-10-11 08:11:03 UTC RE: [CAD_CAM_EDM_DRO] hi -- Algorithm for Position in a Circle.