Implementation of Algorithm in Numerical Control System

In the numerical control system, the interpolation algorithm is one of the most basic subroutines for generating machining trajectories, which largely determines the machining accuracy and maximum feed rate of CNC machine tools. The traditional DDA circular interpolation calculation process is simple, but the tangential approach to the arc causes errors. In this paper, a new circular DDA interpolation algorithm is proposed. The improved algorithm uses the secant to approximate the arc, which can reduce the radial error and the interpolation precision is high. The error analysis results show that the DDA circular interpolation improvement algorithm has obvious Advantages can effectively improve calculation accuracy and calculation efficiency.

1The traditional DDA circular interpolation algorithm provides the starting point and end point of the arc in the XZ plane and the offset of the center of the circle relative to the starting point for the block of the circular interpolation in the user-programmed part program. 0 value. Taking the straight circle of the first quadrant as an example, the implementation of the traditional DDA circular interpolation algorithm is illustrated.

In the XZ coordinate system of the machine tool, the starting point of the arc is A, the center of the circle is C, and the origin of the coordinate axis is shifted to point A to form the IK coordinate system. The origin of the IK coordinate system, that is, the position of the cutting gun, moves with the cutting gun, and the coordinate value of the center C with respect to the origin A is (K, I). After the i-th iteration, the cutting gun moves to the point A i according to the interpolation command, at which point the coordinates of the center C are (K i, I i). In the i+1th iteration, the cutting gun will move in the direction of the tangent A i C', and then the interpolation will be performed one step at the tangent of the slope -K i/I i , and the cutting gun will move to the A i+1 point. At this time, the coordinates of the center C with respect to A i+1 are (I i+1, K i+1).

The feed step size of the X and Z axes of equation (1) can be calculated as follows according to the programming speed by the line A i C ' with a slope of -K i/I i; ΔX i+1=v(3) Therefore, the first quadrant is compliant The circle traditional DDA circular interpolation iteration formula is as follows: (4) I i = I i-1-△X i K i = K i-1-△Z i) Equation (5) X i = X i-1- △X i Z i=Z i-1-△Z i) Equation (6) The first formula in the above formula is used to calculate the feed step size of the coordinate axis in the first interpolation period, and the second formula is used. Correct the current coordinates of the center of the circle relative to the position of the cutting gun. The third formula is used to calculate the command position that the cutting gun should reach. The trajectory in Figure 2 is a trajectory curve formed according to the traditional DDA circular interpolation algorithm, including 8 interpolation points. The radial error caused by the error of the interpolation algorithm itself which approximates the arc by the tangent is large.

2DDA circular interpolation improvement algorithm and its implementation The traditional DDA circular interpolation calculation process is simple, but the tangent is used to approximate the arc to cause errors. The improved algorithm uses a secant to approximate the arc to reduce radial error. The idea of ​​the improved algorithm is shown in Figure 3. The following is an example of a straight circle.

The origin of the IK coordinate system, that is, the position of the cutting gun, moves with the cutting gun, and the coordinate value of the center C with respect to the origin A is (K, I). After the i-th iteration, the cutting gun moves to the point A i according to the interpolation command, at which point the coordinates of the center C are (K i, I i).

In the i+1th iteration, the cutting gun will move to the A i+1 point. A i A i+1 is the tangent of the auxiliary circle A i DA i+1 and the tangent of the auxiliary circle EBF, and R 1 and R 2 are the radii of the auxiliary circle A i DA i+1 and EBF, respectively.

R is the radius of the interpolation arc, because the internal and external average secant can reduce the radial error, so the G-point coordinate can be obtained by the DDA circular interpolation principle (Z g, X g) Z x=Z i+A i G because G , B, C are on a straight line, and the coordinates of point C in the ZX coordinate system are (Z c, X c}, so the coordinates of point B (Z b, X b) are Z b = Z c + Z g (15) because B Is the midpoint of A i A i+1 , so the coordinates of A i+1 (Z i+1, X i+1) are Z i+1=2Z b-Z i X i+1=2b-X i) Equation (16) is interpolated as shown in Figure 4. The start and end positions, according to the DDA interpolation principle, use the tangent of the interpolation arc to connect the interpolation arc and the secant of the approaching arc.

Let the arc interpolation starting point be P o(Z o, X o), the end point be P e(Z e, X e), the deviation of the center of the circle from the starting point of the arc is K 0 and I 0 , and the center of the circle relative to the end point of the arc The deviations are K e and I e , the radius of the arc is R, the feed rate is v, and the interpolation period is T. The improved circular interpolation algorithm is (1) Calculate the auxiliary circle radius R 1 and R 2 R 1= R2) Calculate the tangent slope at the start and end points of the interpolation arc at the starting point: k 0=-k 0/I 0 (19) at the end point: ke=-ke/I e (20)(3) The coordinates of the coordinates A 1 of the intersections A 1 and A n of the tangent of the starting point and the end point of the interpolation arc and the outer auxiliary circle: Z 1 = R 1 2-R 2K 0 / R + Z 0 X 1 = -R 1 2-RI 0 /R+X 0

Equation (22)(4) calculates the first step feed amount ΔZ 1=Z 1-Z 0 Equation (23) △X 1=X 1-X 0 Equation (24) (5) Correction center coordinate K 1=K i-1-Z i I 1=I i-1-X i (Eq. (25)(6) Calculate the auxiliary interpolation step size L=vTR 1 2R 2 Equation (26)(7) according to the formula (13-16) Calculate the command position of the i-th step A i(Z i,X i)(8) Calculate the feed amount △Z i=Z i-Z i-1 (27)△X i=X i-X i-1 Equation (28)(9) discriminates whether or not the end point A n is reached, and if so, the transition term (10), otherwise i is incremented by 1 and then the transition term (5) (10) end trajectory is the trajectory formed by the improved DDA circular interpolation algorithm. The curve and comparison show that the radial error of the improved DDA circular interpolation algorithm is smaller than the original algorithm.

Error Analysis of 3DDA Circular Interpolation Improved Algorithm The following error analysis is mainly for comparing the radial error of the DDA circular interpolation improved algorithm with the string error of the string approaching arc. Under the same step size δ and the same arc radius R, e r1 is the string error of the arc approaching the arc, and e r2 is the radial error of the improved algorithm of DDA circular interpolation. As shown, e r1 is calculated as e r1=R(1-δ2 4R 2) when the string is approaching the arc. (29) As shown, the calculation formula in the DDA circular interpolation improvement algorithm is e. R2=Rδ2 8R 2 Formula (30) Let △er=e r1-e r2 R=1-1-δ2 4R 2 "-δ2 8R 2 Formula (31)K=δR Formula (32) Then △er=1-1 -k 2 4-k 2 8 (33) function image as shown. When 0 < k ≤ 2, △ er > 0, that is, the radial error of the DDA circular interpolation improvement algorithm is smaller than the chord approximation arc String error. And when k>1, the former has obvious advantages when cutting small radius arc. In addition, the DDA circular interpolation improvement algorithm does not include the transcendental function, which can effectively improve the calculation accuracy and calculation efficiency.

4 Summary This paper introduces the circular interpolation algorithm used by the numerical control system.

An improved algorithm based on the traditional DDA circular interpolation algorithm is proposed, and the superiority of the algorithm relative to the string interpolation algorithm is proved by comparison. Practice shows that the DDA circular interpolation improvement algorithm simplifies the calculation steps and improves the calculation speed.

(Finish)

Welded Gabion

Welded Gabion,Welded Gabion Wall,Galfan Welded Gabion Basket,Welded Gabion Box

ANPING HAOCHANG WIRE MESH MANUFACTURE CO.,LTD , https://www.hcgabions.com