Spline curves have been widely used in the CAD/CAM field, but as the ultimate executor of CAD/CAM information, the support of the CNC system is not strong enough: here we try to pass the research without increasing the hardware cost of the system. The tool radius compensation algorithm of the curve introduces a spline curve model in the general numerical control system to improve the cost performance of the domestic CNC system. Tool radius compensation algorithm of 2-spline curve 2.1 Representation method of spline curve and its programming format Spline curve is generally given by n(n≥3) type value points (X j, Y j) given on the plane, j= 1, 2, ..., n means. To introduce a spline curve model in a numerical control system, first define its programming format. Since ISO does not specify the programming of the spline curve, G05, which is not specified by ISO, can be selected as its programming instruction and incorporated into the G00/G01/G02/G03 instruction set. The specific programming format is as follows: 2.2 Processing task of tool radius compensation after introducing spline curve Since the traditional CNC system has only linear and circular arc models, the transition mode between the programmed trajectory blocks is only straight line, straight line, arc, and arc Straight line, arc and arc Four situations. After introducing the spline curve model, the transition mode between the blocks will increase the five types of straight spline curve, spline curve, arc spline curve, spline curve arc and spline curve spline curve. Therefore, the processing task of tool radius compensation should increase the processing of these transition modes accordingly. In addition to the above-mentioned process of the tool compensation process, the tool radius compensation process and the tool compensation cancellation process need to be improved accordingly. 2.3 After introducing the spline curve, the tool radius compensation algorithm is quite mature in the four cases of straight line connecting straight line, straight line connecting arc, arc connecting line and arc connecting arc. The literature has been described in detail, only other transitions are studied. The tool radius compensation algorithm. For each transition mode, there is a shortened type (π ≤ α < 2π) and an elongated type according to the difference of the angle α formed by the two programmed trajectories to be corrected at the inner side (non-machined side) of the workpiece at the transfer. π/2 ≤ α < π) and insert type (0 ≤ α < π/2) three types of tool offset transfer. For insert type tool offset, you can insert a circular arc segment, the radius of the inserted arc is the tool radius; you can also insert several straight line segments. The former makes the transfer path the shortest, but the craftsmanship of the sharp corner processing is relatively poor; the latter can guarantee the technical problem of the sharp corner machining. This article takes the insertion straight line segment as an example. 2.3.1 Straight line spline curve or spline curve line (1) Shortened and extended type tool is as shown. Let the programming trajectory be the straight line L 1 (P 0 P 1), the spline curve S (P 1, P 2,..., P n-1, P n) and L 2 (P n P n+1), and the tool radius is r, Then between L 1 and S is a shortened knife compensation, and between L 2 and S is an extended knife compensation. The tool radius compensation trajectory can be obtained by the following steps: the tool compensation processing method of linearly connecting the straight line, and taking the tool radius r as the spacing, obtaining the straight line segments P 0 P 1 , P 1 P 2 , P 2 P 3..., P n -1 P n, P n P n+1 equidistant lines P 0'P 1 ', P 1 'P 2', P 2'P 3'..., P n-1 'P n ', P n'P n+1' ; all the transition vectors outside the start and end of the spline (vector from the intersection of the programmed trajectory pointing to the intersection of the tool center trajectory) P i P i'(i=2,3,...n-1), the length of the intercept is r Line segment P i P i', get point P i'(i=2,3,n-1); with discrete points P 1 ', P i'(i=2,3,...n-1), P n 'Build tool radius compensation track S' for programming spline. After obtaining S', the CNC system can interpolate the tool compensation path according to the method provided by the literature. (2) The insert type knife is as shown. The programming linear path L 2 (P n P n+1) and the spline curve are inserted type tool compensation, and the calculation process of the tool radius compensation trajectory is as follows: the straight line is inserted into the linear interpolation type tool compensation processing method, and the tool radius r is For the spacing, find the equidistant lines P n-1 'P n ', A 3 P n+1 ' of the straight line segments P n-1 P n, P n P n+1 , such as P n points P n-1 P n, P n The perpendicular lines of P n+1 intersect P n-1 'P n ', A 3 P n+1 ' at P n ' and A 3 points respectively; P n 'A 1 = on the extension line of P n-1 'P n ' r, take A 3 A 2=r on the extension line of P n+1'A 3 and connect A 1 A 2; On all the transition vectors P i P i' (i = 2, 3, ... n-1) outside the start and end points of the spline, a line segment P i P i ' of length r is truncated to obtain a point P i ' ( i=2,3,...n-1); construct the tool radius of the programmed spline with discrete points P 1 ', P i'(i=2,3,...n-1), P n' as the value points The compensation track S'; P n'A 1 , A 1 A 2 is the inserted tool compensation track segment, and A 2 P n+1 ' is the tool compensation track segment of the programmed straight track P n P n+1. 2.3.2 Arc-shaped spline curve or spline curve connected to the arc (1) Short-cut and extended-type tool compensation, set the programming path to arc C 1 (P 0 P 1), spline curve S (P 1, P 2, ..., P n-1, P n) and C 2 (P n P n+1), the tool radius is r, then between C 1 and S is a shortened tool offset, between C 2 and S Elongated knife repair. The tool radius compensation trajectory can be obtained by the following steps: the tool compensation processing method of connecting the arcs in a straight line, and taking r as the distance, obtaining the concentric circle P 0'P 1' of the arc segments P 0 P 1 and P n P n+1 , P n'P n+1' and equidistant lines P 1 'P 2', P 2 'P 3'..., P n-1 of the straight line segments P 1 P 2 , P 2 P 3 . . . , P n-1 P n 'P n', as on all transition vectors P i P i' (i=2, 3, ... n-1) outside the start and end of the spline, intercepting the line segment P i P i' of length r, Get the point P i'(i=2,3,...n-1);? The tool radius compensation trajectory S' of the spline curve is constructed with the discrete points P 1 ', P i' (i=2, 3, ... n-1), P n ' as the type points. (2) The insert type tool offset of the insert type knife complement arc spline curve is similar to the insert type tool fill of the straight line spline curve. Assume that the programmed trajectory P n P n+1 arc, the calculation process of the tool radius compensation trajectory is as follows: with r as the distance, find the equidistant line P n-1 'P n' of the straight line segment P n-1 P n And the concentric circle P n'P n+1' of the arc segment P n P n+1; the crossing P n is the perpendicular of the P n-1 P n P n-1 'P n' to P n ', and P n is P The radial straight line P n 'P n+1' of n P n+1 is at P n'; P n'A 1=r is taken on the extension line of P n-1 'P n ', P n'A 2=r is taken on the tangent line of P n+1 'P n ', and A 1 A 2 is connected, then P n 'A 1, A 1 A 2, A 2 P n' is the inserted tool compensation track segment, P n'P n+1' is the arc tool compensation track segment; the tool path of the spline curve is the same as the straight line curve curve Insert type tool compensation. 2.3.3 Spline curve The sample curve is shown in Fig. 5. Let the programming trajectory be the spline curve S 1 (P 0, P 1,...P m-1, P m) and S 2 (P m, P m+1,... P n-1, P n), the tool radius is r, then the tool offset between S 1 and S 2 can be converted into a tool offset between the straight line segments P m-1 P m and P m P m+1. However, the type of transfer at this time is generally insert type and shortened type (if it is elongated type, the two sample curves are generally combined). Shortening type (elongated type) tool compensation calculation process: ? Taking r as the pitch, the equidistant line P 0 of the straight line segments P 0 P 1 , P 1 P 2 , . . . P m-1 P m, P m P m+1 . . . , P n-1 P n , P n P n+1 is obtained. 'P 1', P 1 'P 2', ..., P m-1 'P m ', P m'P m+1'...P n-1'P n', P n'P n+1'; in the spline curve On all transition vectors P i P i' (i=2,3,m-1,m+1...n-1) outside the start point and the end point, the line segment P i P i' of length r is truncated to obtain the point P i' (i=2,3,m-1,m+1...n-1); construct programming with discrete points P 1 ', P i'(i=2,3,...n-1), P n' The tool radius compensation track S' of the spline. Spline curve spline curve insertion type tool compensation calculation process: with r as the distance, find the equidistant lines P m-1 'P m' and P m' of the straight line segments P m-1 P m and P m P m+1 P m+1'; the vertical line passing P m as P m-1 P m and P m P m+1 intersects P m-1 'P m ' and P m ' and P m ' respectively; at P m-1 'P m P m'A 1=r on the extension line, P m'A 2=r on the extension line of P m+1'P m', and connect A 1 A 2 , then P m'A 1 , A 1 A 2. A 2 P m' is the inserted tool compensation track segment; the subsequent process is the same as the insert type tool compensation of the straight line spline curve. 2.4 Tool radius compensation establishment and cancellation after the introduction of the spline curve Because the tool radius compensation in the CNC system can be used to establish and cancel the block, only G00 or G01 can be used, and the spline curve is added after the tool set up and undo is processed and the traditional NC system is basically The same, here only consider the case where the tool compensation is established, followed by the spline curve and the spline curve, followed by the tool replenishment segment. The tool compensation can be divided into the following two cases: When the tool compensation segment and the spline curve are not shortened, the tool center will move to the tool vector radius apex at the end of the tool compensation segment. When the tool compensation segment and the spline curve are shortened, the tool center will move to the tool vector radius apex at the start of the spline curve. Knife compensation is the reverse process of tool compensation. It is also divided into two cases: if the spline curve and the tool retraction segment are non-shortened transfer modes, the tool center will move the vertex of the tool radius vector from the beginning of the tool retraction segment. To the end of the programming track. If the spline curve and the tool offset undo segment are the shortened transfer mode, the tool center will move directly to the vertex of the tool radius vector at the end of the spline curve and then to the end of the tool offset undo segment. 2.5 Algorithm Analysis The tool radius compensation algorithm of the above spline curve is not an accurate equidistant line for programming the spline curve, but it can ensure the positional accuracy of each type of value point. Since the spline curve itself is an approximation curve fitted by a point value, this treatment has little effect on the final contour machining accuracy, especially if there are enough points for a given type. The algorithm makes full use of the mature algorithms existing in the traditional numerical control system, and the calculation workload is small, which can ensure the real-time performance of the system. Therefore, the algorithm presented in this paper has good practicability. 3 Conclusions This paper studies the practical algorithm of tool radius compensation after introducing spline curve model in general numerical control system without increasing the hardware cost. Experiments show that the algorithm has good real-time performance and accuracy meets the requirements. This research bridges the gap between the numerical control system and the spline interpolation algorithm, so that a large number of research results accumulated in the spline interpolation algorithm can be easily put into practical use. (Finish) Punching Machine,Cold Roof Roll Forming Machine,Hydraulic Punching Machine Roof & Wall Roll Forming Machine Co., Ltd. , http://www.wallrollformingmachine.com