数控车床宏程序加工抛物线编程举例
更新日期:2022-07-29  来源:数控工作室

    用宏程序编制如图1所示抛物线Z=X2/8在区间[016]内的程序

 

1 宏程序编制例图

%8002

#10=0     X坐标

#11=0     Z坐标

N10 G92 X0.0 Z0.0

M03 S600

WHILE  #10 LE 16

G90 G01 X[#10] Z[#11] F500

#10=#10+0.08

#11=#10*#10/8

ENDW

G00 Z0 M05

G00 X0

 

世纪星车床数控系统功能测试程序:

 

%0001

 

G92 X100 Z80 ;考机程序

 

WHILE TRUE

 

T0101

 

M08

 

M03 S460

 

G00 X60 Z5

 

G81 X0 Z1.5 F800

 

G81 X0 Z0

 

G00 X100 Z80

 

T0202

 

;M00

 

G00 X60 Z3

 

G80

 

X52.6 Z-133 F800

 

G01X53

 

G71 U1 R0.2 P1 Q2 X0.3 Z0.1

 

G01G42X40

 

N1 G00 X10.6 Z3

 

G01 X20.6 Z-2 F600

 

Z-28

 

G02 X30.6 Z-33 R5

 

G01 Z-43

 

G03 X42.6 Z-49 R6

 

G01 Z-74.9

 

N2 X53.6

 

G40 G00 X60 Z-50

 

G73 U2.7 W0.3 R3 P3 Q4 X0.6 Z0.1

 

G00 G42 X50

 

N3 G01 X44.1 F600

 

X36.6 Z-65

 

Z-73

 

G02 X40.6 Z-75 R2

 

N4 G01 X60

 

G00 G40 X100 Z80

 

T0303

 

;M00

 

G00 X58.6 Z-65

 

M98 P0002 L7

 

G90 G00 X70 Z3

 

G01 G42 X10 F600

 

X20 Z-2

 

Z-28

 

G02 X30 Z-33 R5

 

G01 Z-43

 

G03 X42 Z-49 R6

 

G01 Z-53

 

X36 Z-65

 

Z-73

 

G02 X40 Z-75 R2

 

G01 X44

 

X46 Z-76

 

Z-83

 

G02 Z-113 R25

 

G03 X52 Z-122 R15

 

G01 Z-133

 

G01 X60

 

G00 G40 X100 Z80 ;

 

M05

 

T0404

 

;M00

 

M03 S220

 

G00 X30 Z5

 

G82 X19.3 Z-20 R-3 E1 C2 P120 F3

 

G82 X18.9 Z-20 R-3 E1 C2 P120 F3

 

X18.7 Z-20 R-3 E1 C2 P120 F3

 

X18.7 Z-20 R-3 E1 C2 P120 F3

 

G76 C2 R-3 E1 A60 X18.7 Z-20 K0.65 U0.1 V0.1 Q0.6 P240 F3

 

G00 X100 Z80

 

M09

 

M05

 

ENDW

 

M30

 

%0002

 

G91 G01 G42 Z-5 F1060

 

Z-13

 

G02 Z-30 R25

 

G03 X6 Z-9 R15

 

G01 X4

 

G00 Z57

 

G01 G40 X-12

 

M99