
Fig. 1 Equal-error linear approximation of non-circular curves
1 INTRODUCTION
Most CNC machine tools lack interpolation commands for tool nose trajectories of non-circular curves, so these curves are typically approximated using straight-line segments or arc segments during CNC programming. Among these methods, straight-line replacement is more commonly used due to its simplicity and intuitiveness. As shown in Figure 1, the approach involves replacing a non-circular curve with a series of straight-line segments, forming a polyline. Points such as a, b, c, d, etc., are referred to as nodes. The main challenge in NC programming lies in accurately determining these nodes. To simplify calculations, nodes are often determined using either equal spacing or equal step methods. In the equal spacing method, the x-axis projection of each node is evenly spaced, while in the equal step method, the length of each straight segment is kept constant. However, both methods can lead to uneven surface finish and machining errors when the curvature of the curve between nodes changes significantly. Additionally, since the spacing and step size depend on the minimum radius of curvature, many nodes are generated, increasing computational complexity and programming workload. Using the equal error linear approximation method can effectively address these issues.
2 THEORETICAL CALCULATION OF EQUAL ERROR LINEAR APPROXIMATION
As shown in Figure 1, the key feature of the equal error linear approximation method is that the error between the non-circular curve and the straight line remains constant. The steps involved are as follows: Start at point a (xa, ya), draw a circle with radius d around it, resulting in the equation:
(x - xa)² + (y - ya)² = d² (1)
The slope of the common tangent PT between the circle and the curve is given by:
K = (yT - yp) / (xT - xp) (2)
Where xT, yT, xp, and yp are obtained by solving the following system:
{ yT - yp = f1’(xp)(xT - xp)
yp = f1(xp)
yT - yp = f2’(xT)(xT - xp)
yT = f2(xT) } (3)
If the slope of chord ab is K, the equation of the chord is:
y - ya = K(x - xa) (4)
Solving this equation together with the curve equation gives the coordinates of point b. This process is repeated to find points c, d, e, and so on.
3 NODE CALCULATION USING EQUAL ERROR LINEAR APPROXIMATION
In NC machining, the tool nose trajectory is often modeled as a parabola y = ax² (a > 0, x > 0), with derivative y’ = 2ax. Using the tolerance circle equation (1), we derive:
{ y = ya - [d² - (x - xa)²]¹â„²
y’ = -(x - xa)/(y - ya) } (6)
This leads to the system:
{ yT - yp = - (xp - xT)(xT - xp)
yp - yT = ya - [d² - (xp - xT)²]¹â„²
yT - yp = 2axT(xT - xp)
yT = axT² } (7)
Combining these equations results in:
4au³ - 4au²ya - t³ + 4aut³ + 4autxa = 0 (8)
Where t = xp - xa and u = (d² - t²)¹â„². Solving this equation numerically allows us to determine the next node. Using the linear equation from (5), the next node coordinates can be calculated iteratively.
4 PROGRAM DEVELOPMENT IN AUTOCAD VBA
A program was developed in the AutoCAD VBA environment to implement the equal error linear approximation method. The flowchart of the program is shown in Figure 2. For a parabolic tool path with a tolerance of d = 0.05, the simulated polygonal line trace is illustrated in Figure 3. Node data is saved in a file named "c:/data.txt," as shown in Figure 4. A subroutine was written to solve the nonlinear equation, using iterative methods to find the root.
5 EXTENSION TO OTHER NON-CIRCULAR CURVES
The method can be adapted to other non-circular curves by modifying the equation in the program. For example, when dealing with a hyperbolic curve, the expression for t is adjusted accordingly. Instead of using the original formula, a new expression such as "texpr = t² + t*xa - u*ya - 2*sqrt(u*t)" may be used.
6 CONCLUSION
The equal error linear approximation method provides an efficient way to approximate non-circular curves in NC programming. It minimizes the number of nodes and control blocks, ensuring high surface and dimensional accuracy. Although the calculation is complex, the program developed in the AutoCAD VBA environment enables accurate and efficient node calculation. Its portability and adaptability make it a valuable tool for various non-circular curve applications. Furthermore, it allows simulation of the difference between the tool path and the actual curve, offering significant practical value.
High Temperature Tape
High Temperature Tape,Waterproof Cloth Tape,High Temp Cloth Tape,Electrical Tape
Kunshan An De Qing Electric Technology Co., Ltd. , https://www.andeqing.com