Apr 18, 2025 Leave a message

How to manually program curved workpieces to make NC programs concise and efficient?

 

Some time ago, a teacher took a laser reflector part with a parabola as the inner contour, and developed the part program from drawing the curve in the software to programming. He never expected that the program generated by the software was so large, and the efficiency of checking, modifying, debugging and processing was too low.

He came to me and asked me to help write a concise and universal CNC program. I will use this as an example to explain the two steps of curve type programming, hoping to give you a good inspiration.

Picture
Add WeChat: Yuki7557 to get 10G CNC tutorial

Step 1: Set variables and substitute them into the equation

The ellipse parameter equation in the above figure is:

X=147.05441*cos(t)

Y=85*sin(t)

It is marked according to the coordinates X-Y when drawing. The 2-axis CNC machine is the X and Z axis, so it is changed to:

Z=147.05441*cos(t)

X=85*sin(t)

Set the variables into the equation as follows:

#25=#1*COS[#3] (ellipse parameter equation Z=a*COS(t) )

#24=#2*SIN[#3] (ellipse parameter equation X=b*SIN(t) )

Some people may say that they are poor in mathematics and do not understand equations. In fact, it does not matter if you do not understand equations. The purpose of this step is to convert the ellipse parameter equation into other macro variables that can be set for CNC machine tools. (For example, the macro variables of the Falak system are # and numerical representation, and Siemens is R….)

Step 2: Use equations to calculate coordinate points

Because the contour of any workpiece can be seen as composed of countless small points, and then the points are connected by small line segments, thus forming a variety of products.

Ellipse parametric equation:

#24=#2*SIN[#3] (ellipse parametric equation X=b*SIN(t) )

#25=#1*COS[#3] (ellipse parametric equation Z=a*COS(t) )

Give #3 different values ​​(i.e., through the self-increment operation of variable #3), the equation can be used to calculate the X and Z values ​​on the ellipse contour curve, and then the curve contour processing is completed through G01X_Z_ two-axis interpolation

The program is as follows:

%O0001

N01 #1=147.05441 (#1 represents the longitudinal semi-axis a of the ellipse)

N02 #2=85 (#2 represents the transverse semi-axis b of the ellipse)

N03 #3=90 (#3 represents the starting angle, and the starting angle is 90 degrees for processing the left half of the ellipse)

N04 G54 S800 M03

N05 T0101

N06 G00 X170 Z200

N07 G00 Z1

N08 #24=#2*SIN[#3] (Ellipse parameter equation X=b*SIN(t) )

N09 #26=#1*COS[#3] (Ellipse parameter equation Z=a*COS(t) )

N10 G41 (Establish compensation)

N11 G01 X[2*#24] Z#26 F0.3 (Turn one cut)

N12 #3=#3+3 (Calculate the next angle increment)

N13 IF[#3 LT180]GOTO8 (If the car is not in place, continue to go back to the car)

N14 G40 (Cancel compensation)

N15 G00 Z200 M05 (Return to the safe point)

N16 G00 X250 (Return to the safe point)

M30 (Procedure ends)

%

 

 

 

Send Inquiry

whatsapp

skype

E-mail

Inquiry