宏程序是如何根据数学公式进行计算加工的

技术小编 4206 0


我们知道,对于各种曲线,cnc系统将根据内部的算术将其划分成许多小块线。


现在我们将使用一个圆的标准公式来演示CNC车削加工如何使用这种方法来编程一个圆的宏程序。


(We know that for all kinds of curve, cnc system will divide it intomany small pieces lines based on arithmetics inside. Now we will use standardformula of a circle to demonstrate how to use this method to program a macroprogram for a circle.) 


以下是标准圆的数学公式: X * X + Y * Y = R * R,数学解析几何不好的不伙伴们有空还是要恶补一下的哦:


1.  代替X和Y使用宏参数#1和#2

2.  圆弧可以沿#1方向分成小线,然后计算线的每一端的坐标和cnc车床系统中的坐标。

3.  下一步是沿着所有的小线进行编程。


(The following is standard circle formula:

X*X+Y*Y=R*Rreplace X and Y use macro parameters #1and #2)


以下是精加工的宏程序:


(The following is themacro program for finishing machining)

G0X0

G1Z0F0.1

#1=0

N10#2=SQRT[20*20-#1*#1]  

SQRT#3=#1-20 (圆的原点在工作原点左20mm,origin of the circle is left on the work origin 20mm)

#4=2*#2 (编程直径, program asdiameter )

G1X[#4]Z[#3]F0.1(cut through smallline)

#1=#1-0.5 变量值越小越好,曲线会更加顺畅, more small the value is, the curve will be more smooth)

IF[#1GE0] GOTO 10 判断曲线是否结束,judge ifgot to the end of the curve)

G1X42 通过直线进刀切圆弧,cut from the arc through a straight line)


对于粗加工,设置偏置阀#5,更改程序如下


(For the rough machining, set a offset valve #5, change the programas follow:)

T0101

M3S800

G0X42Z5

#5=36

N5G0X[#5]

G1Z0F0.1

#1=20

N10#2=SQRT[20*20-#1*#1]    

#3=#1-20  圆弧中的所有点,Z值减去20,all the point in the arc, Z value subtract20

#4=2*#2+#5      

G1X[#4]Z[#3]F0.1  

#1=#1-0.5         

IF[#1 GE 0] GOTO 10 

G1X42            

G0Z5

#5=#5-4 使偏移减少,make the offset decrease )

IF[#5 GE 0] GOTO 5

G0X150Z150

M5

M30

%


结语:知识的系统性很重要,这样可以有效解决技术上的不连续性。

曾经几时有所谓宏程序大神级别说道,不学好数学也照样可以学好CNC数控宏编程………,如此云云的太多了,诚然,技术在没有转化为一种商业模式来兑现,也可以认为是一张支票而已…..

平心而论,这些类别的“大神”你自已是这样过来的吗,你的速成论表面只是心态的迎合,另一层面就是误导,更深层次就是有目的。

技术是传承,是积淀,是厚积薄发,宏编程亦是如此,不二法则!!!




抱歉,评论功能暂时关闭!