版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、精选优质文档-倾情为你奉上一、课程设计的内容用计算机高级编程语言(如VB,VC+等)来实现数控装置中的一个基本的功能刀具补偿功能(亦即仿真数控装置的刀具补偿功能),要求对任意给定的某一由直线与圆弧组成的平面几何轮廓:二、课程设计的要求与数据具体的要求如下:(1)能实现四种转接(直线直线、直线圆弧、圆弧直线、圆弧圆弧);(2)能实现三种过渡方式(伸长型、缩短型、插入型);(3)能实现左、右刀补(即G41,G42)。(4)在屏幕上绘出刀具的中心轨迹。三、课程设计应完成的工作每个学生应在规定时间内,独立完成所选题目。运用VB编程语言,编写计算机软件在WINDOWS实现数控装置的计算机仿真。要求清楚地
2、分析问题、提出算法、确定人机界面、列出流程图,最后用程序验证,完成软件测试,并且提交程序说明书。对选择典型零件编程题目的学生,要求用编写计算机软件的方法解决数控过程的一个问题。可以任选用本人熟悉的一种编程语言,要求清楚地分析问题、提出算法、列出流程图,最后用程序验证,并且提交程序说明书。四、课程设计进程安排序号设计各阶段内容地点起止日期11、布置任务,领取课程设计任务书,了解课程设计的目的、内容和要求;了解课程设计的步骤;2、理解本课程设计题目的具体内容要求,根据各自不同情况选择题目;教室第18周 第20周2了解和掌握有关软件开发的知识,如VB编程、VC编程、软件工程、软件开发的常用技巧及注意
3、事项;3调查研究,收集资料,查阅文献。学生对所选题目进行论证及确定设计方案, 4掌握数控结构设计要求,具体技术指标和计算要求; 进行机械结构设计或者软件设计;5进行数控系统和算法的软件编程与开发,初步实现系统的基本功能6通过多个实例来验证和改进系统功能,完善软件界面7对所开发的软件程序进行标识和说明8按要求的格式编制课程设计说明书9课程设计答辩专心-专注-专业目录一、内容提要.2二、软件功能介绍.22.1软件窗口界面.22.2软件功能简介.2三、刀具半径补偿知识.33.1概念.33.2主要用途.33.3常用方法.3四、刀具半径补偿算法.44.1转接点算法说明.44.2刀具补偿算法.6五、仿真结
4、果图.8六、设计总结.9七、参考文献.10八、附录(部分代码).11一、内容提要本文介绍了以Visual Basic 6.0为开发工具,制作程序来实现数控装置中的一个基本的功能-刀具补偿功能(亦即仿真数控装置的刀具补偿功能),要求对任意给定的某一由直线与圆弧组成的平面几何轮廓;(1)能实现四种转接(直线-直线,直线-圆弧,圆弧-直线,圆弧-圆弧);(2)能实现三中过渡方式(伸长型,缩短型,插入型);(3)能实现左,右刀补(即G41,G42)。(4)在屏幕上绘出刀具的中心轨迹。 在程序中讨论了刀具半径补偿的原理,并介绍了如何判断缩短型,伸长型和插入型,如何实现直线与直线,直线与圆弧,圆弧与直线,
5、圆弧与圆弧的转接二、软件功能介绍2.1本模拟软件有一个窗口,图形界面如下:2.2、软件功能简介:(1)软件能实现任何直线、圆弧交叉多段线段的连接刀具插补加工;(2)能实现直线直线、直线圆弧、圆弧直线、圆弧圆弧刀具补偿;(3)可以实时在窗体中输入图形参数,实现加工;(4)刀具半径可以变换大小三、刀具半径补偿知识3.1概念:根据按零件轮廓编制的程序和预先设定的偏置参数,数控装置能实时自动生成刀具中心轨迹的功能称为刀具半径补偿功能。根据ISO标准,当刀具中心轨迹在编程轨迹(零件轮廓)前进方向的右边时,称为右刀补,用G42指令实现;反之称为左刀补,用G41指令实现。3.2主要用途数控装置大都具有刀具半
6、径补偿功能,这为程序编制提供了方便。当编制零件加工程序时,可利用刀具半径补偿功能,直接按零件轮廓进行编程,而不需要进行大量的刀具中心运动轨迹的计算。采用刀具半径补偿后,数控系统能自动计算出刀具中心的偏移向量,进而得到偏移后的刀具中心轨迹,并使系统按中心轨迹运行。具体体现在以下两个方面:1) 由于刀具的磨损或因换刀引起的刀具半径变化时,不必重新编程,只须修改相应得偏置参数即可。2) 由于轮廓加工往往不是一道工序能完成的,在粗加工时,要为精加工工序预留加工余量。加工余量的预留可通过修改偏置参数实现,而不必为粗、精加工各编制一个程序。3.3常用方法刀具半径补偿分为B类补偿和C类补偿。B刀补的特点是刀
7、具中心轨迹的段间连接都是以圆弧进行的;C刀补的特点是相邻两段轮廓的刀具中心轨迹之间用直线进行连接。B类补偿只能实现在本程序段内的刀具半径补偿,而对程序段间的过渡不予处理。只有B类刀具半径补偿功能的数控系统,使用时,对有外轮廓(外拐角)部分,必须增加尖角过渡辅助程序段;对内轮廓(内拐角),会产生过切现象。刀具半径C类补偿功能可实现自动尖角过渡,只要给出零件轮廓的程序数据,数控系统就能自动地进行拐角处的刀具中心轨迹交点的计算,采用的算法是一次进行两段直线的处理,C类补偿功能可用于内、外拐角轮廓的加工。四、刀具半径补偿计算4.1转接点算法说明4.2刀具补偿算法刀具算法即计算各种转接类型的转接点的坐标
8、值,下属刀补算法中,假设刀具半径d,圆弧半径R4.2.1直线接直线的情况假设第一段直线L1的起点为(,),终点为(,),第二段直线L2的起点为(,),(,)。第一段直线L1的方向矢量为第二段直线L2的方向矢量为缩短型直线1与直线2终点采用角度计算刀具半径矢量的计算:以rd表示刀具半径矢量,1表示对应的直线编程矢量与X轴正向的夹角,则可求出:G41: rdx=rd*(-sin1)rdy=rd*(cos1)G42: rdx=rd*(sin1)rdy=rd*(-cos1)对刀具中心轨迹起点的计算:通过对左、右刀补及各种线型的转接分析,得出其通用的计算公式:Jx=Ox+rdxJy=Oy+rdy对刀具中
9、心轨迹终点的计算:左刀补时:c=1;右刀补时:c=-1;Kx=Fx-c*rd*sin2Ky=Fy+c*rd*cos2因此,只要配合直线的斜率就能计算出转接点的坐标,从而完成刀具补偿。 伸长型其计算方法与缩短型一样。插入型 刀补进行有两个转接点,采用角度判别计算,其坐标值的计算公式如下:对左刀补(G41)kk=1;对右刀补(G42)kk=-1插入点计算公式为:C1x=Ax+rd*(cos1-kk*sin1)C1y=Ay+rd*(sin1+kk*cos1)C2x=Ax+rd*(-cos2-kk*sin2)C2y=Ay+rd*(-sin2+kk*cos2)4.2直线接圆弧的情况 假设直线L的起点为(
10、,),终点为(,),圆弧C的起点为(,),终点为(,),圆心相对于圆弧起点的坐标为(I,K)。刀补圆弧的半径为:r=rd*kc+ 顺圆时kc=1,逆圆时为-1。直线接圆弧的伸长型刀补进行转接点求法如图所示,其中有两个转接点,首先求出两切线夹角的平均数,利用求出的角度计算过渡直线的斜率,从而得出直线与过渡直线的交点与直线与圆弧的交点。4.3.圆弧接直线的情况其原理与直线接圆弧相同。4.4.圆弧接圆弧的情况缩短型刀补进行:圆弧接圆弧的缩短型刀补进行转接点求法很简单,只要求出其刀补圆弧的交点就可以画出刀补情况。伸长型刀补进行:圆弧接圆弧的伸长型刀补进行转接点求法与缩短型相类似。插入型刀补进行:圆弧接
11、圆弧的插入型刀补进行转接点求法与直线圆弧相类似。五、仿真结果图5.1直线与直线5.2直线与圆弧5.3圆弧与圆弧六、设计总结这个基于VB的刀补程序是用几何方法编写的,以矢量夹角为判断标准.程序分为直线直线;直线圆弧;圆弧-直线;圆弧圆弧四大类。我这次编写的程序所用的方法是很基本的几何逻辑原理,都是高中的几何知识,十分浅显.但比较冗长。通过本次课程设计我受益良多,不仅巩固了数控技术的知识,另外,在编程实现所需功能的时候,需运用数学知识,而且需考虑各种可能出现的情况。因此,这次课程设计也提高了个人分析问题的能力。经过这次独立地编写这个刀具半径补偿程序,使我对VB有了更为深刻认识. 由于能力有限,本软
12、件有一定的局限性,仿真不具有通用性,程序编写的过程中,有很多地方想的不周密而令到程序不是很严谨,请见谅! 今后我会继续努力,做得更好。最后感谢高院长的指导,指导了我们这个课程设计,谢谢老师的辛苦劳动!七参考文献1机床设计手册第三分册2廖效果.数字控制机床.武汉:华中理工大学出版社.1992.93廖效果.数控技术. 武汉:湖北科学技术出版社.2000.74刘又午.数字控制机床.北京:机械工业出版社5龚浦泉.机床电气控制.重庆:重庆大学出版社6 谭浩强.Basic语言结构化程序设计教程.北京:中国科学技术出版社.19907 杨林,李继良. Visual Basic编程高手.北京:北京大学出版社.2
13、000八、附录(部分代码)Dim ax As Double, ay As Double, cx As Double, cy As Double, dx As Double, dy As Double, ex As Double, ey As Double, rx As DoubleDim ry As Double, bx As Double, by As Double, a1 As Double, a2 As Double, a3 As Double, a4 As Double, c1 As Integer, c2 As IntegerDim r1 As Double, r2 As Doubl
14、e, x1 As Double, x2 As Double, x3 As Double, x4 As Double, y1 As Double, y2 As Double, y3 As DoubleDim y4 As Double, d As Integer, db As Double, term As Integer, l1 As Double, l2 As Double, w1 As Double, w2 As DoubleDim j11 As Double, j1 As Double, j2 As Double, j3 As Double, jj As Double, jjs As Do
15、uble, jjs1 As Double, hx As DoubleDim hy As Double, kx As Double, ky As Double, fx As Double, fy As Double, pd As Double, jx As Double, jy As Double, jx1 As DoubleDim jy1 As Double, jx2 As Double, jy2 As Double, tana1 As Double, tana2 As Double, b1 As Double, b2 As Double, bj1 As DoubleDim bj2 As Do
16、uble, ka As Integer, kb As Integer, kc As Integer, kd As Integer, we As Integer, zzqx As Double, zzqy As Double, lx As DoubleDim ly As Double, zya As Double, zyb As Double, zyc As Double, rr1 As Double, rr2 As Double, aa1 As Double, aa2 As Double, kc1 As IntegerDim kc2 As Integer, zj As Double, jxx1
17、 As Double, jxx2 As Double, jyy1 As Double, jyy2 As Double, zzj As Double . . . . '当非加工角大于90度时 Select Case p Case 12rr1 = r1 + kc1 * dbrr2 = r2 + kc2 * db q = (r1 + db * kc1) * (r1 + db * kc1) - (r2 + db * kc2) * (r2 + db * kc2) w = rx - ex e = q + w * w - ry * ry + ey * ey a11 = 4 * (ry - ey) *
18、 (ry - ey) + 4 * w * w b11 = 4 * e * (ry - ey) - 8 * w * w * ry c11 = e * e - 4 * w * w * (r1 + kc1 * db) * (r1 + kc1 * db) + 4 * w * w * ry * ry Call jec(a11, b11, c11, jy1, jy2) jy11 = jy1 jy12 = jy1 jy13 = jy2 jy14 = jy2 jx11 = rx + Sqr(r1 + kc1 * db) * (r1 + kc1 * db) - (ry - jy1) * (ry - jy1) j
19、x12 = rx - Sqr(r1 + kc1 * db) * (r1 + kc1 * db) - (ry - jy1) * (ry - jy1) jx13 = rx + Sqr(r1 + kc1 * db) * (r1 + kc1 * db) - (ry - jy2) * (ry - jy2) jx14 = rx - Sqr(r1 + kc1 * db) * (r1 + kc1 * db) - (ry - jy2) * (ry - jy2) Call huayuan(jx11, jy11, ex, ey, rr5, aa5) Call huayuan(jx12, jy12, ex, ey,
20、rr6, aa6) Call huayuan(jx13, jy13, ex, ey, rr7, aa7) Call huayuan(jx14, jy14, ex, ey, rr8, aa8) m = 0 If rr5 = rr2 Then jx1 = jx11 jy1 = jy11 aaa1 = aa5 m = 1 Else If rr6 = rr2 Then If m = 0 Then jx1 = jx12 jy1 = jy12 aaa1 = aa6 m = 1 Else jx2 = jx12 jy2 = jy12 aaa2 = aa6 End If Else If rr7 = rr2 Th
21、en If m = 0 Then jx1 = jx13 jy1 = jy13 aaa1 = aa7 m = 1 Else jx2 = jx13 jy2 = jy13 aaa2 = aa7 End If Else If rr8 = rr2 Then jx2 = jx14 jy2 = jy14 aaa2 = aa6 End If End If End If End If If (a1 - aaa1) * Sgn(a1 - aaa1) < (a1 - aaa2) * Sgn(a1 - aaa2) Then jx = jx1 jy = jy1 Else jx = jx2 jy = jy2 End
22、 If Call huayuan(jx, jy, rx, ry, rr1, aa1) If c1 = 0 Then Picture1.Circle (rx, ry), rr1, RGB(255, 0, 0), a1, aa1 Else Picture1.Circle (rx, ry), rr1, RGB(255, 0, 0), aa1, a1 End If Call huayuan(jx, jy, ex, ey, rr2, aa2) If c2 = 0 Then Picture1.Circle (ex, ey), rr2, RGB(255, 0, 0), aa2, a4 Else Pictur
23、e1.Circle (ex, ey), rr2, RGB(255, 0, 0), a4, aa2 End If Case 13 zj = pd / 2 + j1 If zj > 8 * Atn(1) Then zj = zj - 8 * Atn(1) End If If zj <> 0 And zj <> 2 * Atn(1) And zj <> 4 * Atn(1) And zj <> 6 * Atn(1) And zj <> 8 * Atn(1) Then b1 = by - bx * Tan(zj) axx = (1 +
24、Tan(zj) * Tan(zj) bxx = (2 * (b1 - by) * Tan(zj) - 2 * bx) cxx = bx * bx + (b1 - by) * (b1 - by) - db * db Call jec(axx, bxx, cxx, jzx1, jzx2) jzy1 = jzx1 * Tan(zj) + b1 jzy2 = jzx2 * Tan(zj) + b1 Call pp(jzx1, jzy1, jzx2, jzy2, rx, ry, jzxx, jzyy) bzj = jzyy + jzxx / Tan(zj) aax = (1 + 1 / (Tan(zj)
25、 * Tan(zj) bbx = (-1) * 2 * (bzj - ry) / Tan(zj) - 2 * rx) ccx = rx * rx + (bzj - ry) * (bzj - ry) - (r1 + kc1 * db) * (r1 + kc1 * db) Call jec(aax, bbx, ccx, jx11, jx12) jy11 = (-1) * jx11 / Tan(zj) + bzj jy12 = (-1) * jx12 / Tan(zj) + bzj Call pp(jx11, jy11, jx12, jy12, bx, by, jx1, jy1) aaa = (1
26、+ 1 / (Tan(zj) * Tan(zj) bbb = (-1) * 2 * (bzj - ey) / Tan(zj) - 2 * ex) ccc = ex * ex + (bzj - ey) * (bzj - ey) - (r2 + kc2 * db) * (r2 + kc2 * db) Call jec(aaa, bbb, ccc, jx21, jx22) jy21 = (-1) * jx21 / Tan(zj) + bzj jy22 = (-1) * jx22 / Tan(zj) + bzj Call pp(jx21, jy21, jx22, jy22, bx, by, jx2,
27、jy2) Call huayuan(jx1, jy1, rx, ry, rr1, aa1) If c1 = 0 Then Picture1.Circle (rx, ry), rr1, RGB(255, 0, 0), a1, aa1 Else Picture1.Circle (rx, ry), rr1, RGB(255, 0, 0), aa1, a1 End If Call huayuan(jx2, jy2, ex, ey, rr2, aa2) If c2 = 0 Then Picture1.Circle (ex, ey), rr2, RGB(255, 0, 0), aa2, a4 Else P
28、icture1.Circle (ex, ey), rr2, RGB(255, 0, 0), a4, aa2 End If Picture1.Line (jx1, jy1)-(jx2, jy2), RGB(255, 0, 0) End If End SelectCase 2pd = 8 * Atn(1) - pd zj = j1 - pd / 2 If zj > 8 * Atn(1) Then zj = zj - 8 * Atn(1) End If If pd > 2 * Atn(1) Then p = 12 Else p = 13 End If If c1 = 0 Then kc1
29、 = 1 Else kc1 = (-1) End If If c2 = 0 Then kc2 = 1 Else kc2 = (-1) End If If pd > 2 * Atn(1) Then p = 12 Else p = 13 End If '当非加工角大于90度时 Select Case p Case 12rr1 = r1 + kc1 * dbrr2 = r2 + kc2 * db q = (r1 + db * kc1) * (r1 + db * kc1) - (r2 + db * kc2) * (r2 + db * kc2) w = rx - ex e = q + w
30、* w - ry * ry + ey * ey a11 = 4 * (ry - ey) * (ry - ey) + 4 * w * w b11 = 4 * e * (ry - ey) - 8 * w * w * ry c11 = e * e - 4 * w * w * (r1 + kc1 * db) * (r1 + kc1 * db) + 4 * w * w * ry * ry Call jec(a11, b11, c11, jy1, jy2) jy11 = jy1 jy12 = jy1 jy13 = jy2 jy14 = jy2 jx11 = rx + Sqr(r1 + kc1 * db)
31、* (r1 + kc1 * db) - (ry - jy1) * (ry - jy1) jx12 = rx - Sqr(r1 + kc1 * db) * (r1 + kc1 * db) - (ry - jy1) * (ry - jy1) jx13 = rx + Sqr(r1 + kc1 * db) * (r1 + kc1 * db) - (ry - jy2) * (ry - jy2) jx14 = rx - Sqr(r1 + kc1 * db) * (r1 + kc1 * db) - (ry - jy2) * (ry - jy2) Call huayuan(jx11, jy11, ex, ey
32、, rr5, aa5) Call huayuan(jx12, jy12, ex, ey, rr6, aa6) Call huayuan(jx13, jy13, ex, ey, rr7, aa7) Call huayuan(jx14, jy14, ex, ey, rr8, aa8) m = 0 If rr5 = rr2 Then jx1 = jx11 jy1 = jy11 aaa1 = aa5 m = 1 Else If rr6 = rr2 Then If m = 0 Then jx1 = jx12 jy1 = jy12 aaa1 = aa6 m = 1 Else jx2 = jx12 jy2
33、= jy12 aaa2 = aa6 End If Else If rr7 = rr2 Then If m = 0 Then jx1 = jx13 jy1 = jy13 aaa1 = aa7 m = 1 Else jx2 = jx13 jy2 = jy13 aaa2 = aa7 End If Else If rr8 = rr2 Then jx2 = jx14 jy2 = jy14 aaa2 = aa6 End If End If End If End If If (a1 - aaa1) * Sgn(a1 - aaa1) < (a1 - aaa2) * Sgn(a1 - aaa2) Then
34、 jx = jx1 jy = jy1 Else jx = jx2 jy = jy2 End If Call huayuan(jx, jy, rx, ry, rr1, aa1) If c1 = 0 Then Picture1.Circle (rx, ry), rr1, RGB(255, 0, 0), a1, aa1 Else Picture1.Circle (rx, ry), rr1, RGB(255, 0, 0), aa1, a1 End If Call huayuan(jx, jy, ex, ey, rr2, aa2) If c2 = 0 Then Picture1.Circle (ex,
35、ey), rr2, RGB(255, 0, 0), aa2, a4 Else Picture1.Circle (ex, ey), rr2, RGB(255, 0, 0), a4, aa2 End If Case 13 zj = pd / 2 + j1 If zj > 8 * Atn(1) Then zj = zj - 8 * Atn(1) End If If zj <> 0 And zj <> 2 * Atn(1) And zj <> 4 * Atn(1) And zj <> 6 * Atn(1) And zj <> 8 * A
36、tn(1) Then b1 = by - bx * Tan(zj) axx = (1 + Tan(zj) * Tan(zj) bxx = (2 * (b1 - by) * Tan(zj) - 2 * bx) cxx = bx * bx + (b1 - by) * (b1 - by) - db * db Call jec(axx, bxx, cxx, jzx1, jzx2) jzy1 = jzx1 * Tan(zj) + b1 jzy2 = jzx2 * Tan(zj) + b1 Call pp(jzx1, jzy1, jzx2, jzy2, rx, ry, jzxx, jzyy) bzj =
37、jzyy + jzxx / Tan(zj) aax = (1 + 1 / (Tan(zj) * Tan(zj) bbx = (-1) * 2 * (bzj - ry) / Tan(zj) - 2 * rx) ccx = rx * rx + (bzj - ry) * (bzj - ry) - (r1 + kc1 * db) * (r1 + kc1 * db) Call jec(aax, bbx, ccx, jx11, jx12) jy11 = (-1) * jx11 / Tan(zj) + bzj jy12 = (-1) * jx12 / Tan(zj) + bzj Call pp(jx11,
38、jy11, jx12, jy12, bx, by, jx1, jy1) aaa = (1 + 1 / (Tan(zj) * Tan(zj) bbb = (-1) * 2 * (bzj - ey) / Tan(zj) - 2 * ex) ccc = ex * ex + (bzj - ey) * (bzj - ey) - (r2 + kc2 * db) * (r2 + kc2 * db) Call jec(aaa, bbb, ccc, jx21, jx22) jy21 = (-1) * jx21 / Tan(zj) + bzj jy22 = (-1) * jx22 / Tan(zj) + bzj
39、Call pp(jx21, jy21, jx22, jy22, bx, by, jx2, jy2) Call huayuan(jx1, jy1, rx, ry, rr1, aa1) If c1 = 0 Then Picture1.Circle (rx, ry), rr1, RGB(255, 0, 0), a1, aa1 Else Picture1.Circle (rx, ry), rr1, RGB(255, 0, 0), aa1, a1 End If Call huayuan(jx2, jy2, ex, ey, rr2, aa2) If c2 = 0 Then Picture1.Circle
40、(ex, ey), rr2, RGB(255, 0, 0), aa2, a4 Else Picture1.Circle (ex, ey), rr2, RGB(255, 0, 0), a4, aa2 End If Picture1.Line (jx1, jy1)-(jx2, jy2), RGB(255, 0, 0) End If End SelectEnd SelectEnd SubPrivate Sub Command2_Click()zz.Enabled = Truezz.Visible = Truezy.Enabled = Falsezy.Visible = Falseyz.Enabled
41、 = Falseyz.Visible = Falseyy.Enabled = Falseyy.Visible = Falseterm = 0zzcc.Enabled = Truezzcc.Visible = Truezycc.Enabled = Falsezycc.Visible = FalseCommand8.Enabled = FalseCommand8.Visible = FalseCommand19.Enabled = FalseCommand19.Visible = FalseEnd SubPrivate Sub Command3_Click()zy.Enabled = Falsez
42、y.Visible = Falsezz.Enabled = Falsezz.Visible = Falseyz.Enabled = Falseyz.Visible = Falseyy.Enabled = Trueyy.Visible = Trueterm = 3zzcc.Enabled = Falsezzcc.Visible = Falsezycc.Enabled = Falsezycc.Visible = FalseCommand8.Enabled = FalseCommand8.Visible = FalseCommand19.Enabled = TrueCommand19.Visible
43、 = TrueEnd SubPrivate Sub Command4_Click()zz.Enabled = Falsezz.Visible = Falsezy.Enabled = Falsezy.Visible = Falseyz.Enabled = Trueyz.Visible = Trueyy.Enabled = Falseyy.Visible = Falseterm = 2zzcc.Enabled = Falsezzcc.Visible = Falsezycc.Enabled = Falsezycc.Visible = FalseCommand8.Enabled = TrueComma
44、nd8.Visible = TrueCommand19.Enabled = FalseCommand19.Visible = FalseEnd SubPrivate Sub Command5_Click()zy.Enabled = Truezy.Visible = Truezz.Enabled = Falsezz.Visible = Falseyz.Enabled = Falseyz.Visible = Falseyy.Enabled = Falseyy.Visible = Falsezzcc.Enabled = Falsezzcc.Visible = Falsezycc.Enabled =
45、Truezycc.Visible = TrueCommand8.Enabled = FalseCommand8.Visible = FalseCommand19.Enabled = FalseCommand19.Visible = Falseterm = 1End SubPrivate Sub Command7_Click()Frame6.Enabled = FalseEnd SubPrivate Sub Command8_Click()Dim p As Integer Dim zzx As Double Dim zzy As Double Dim zza As Double Dim zzb
46、As Double Dim zzc As Double Dim bzzj As Double Dim zxx1 As Double Dim zxx2 As Double Dim z1x1 As Double Dim z1y1 As Double Dim z1x2 As Double Dim z1y2 As Double Dim zya As Double Dim zyb As Double Dim zyc As Double Dim bzj As Double Dim zy1 As Double Dim zy2 As Double Call zyjjjs(x1, y1, x2, y2, a1,
47、 a2, c1, d, j1, j2, j3, jj, pd) Select Case d Case 2 '左刀补时 zj = pd / 2 + j1 If zj > 8 * Atn(1) Then zj = zj - 8 * Atn(1) End If If c1 = 1 Then kc1 = 1 Else kc1 = (-1) End If hx = db * (-1) * Sin(j1) hy = db * (Cos(j1) kx = x1 + hx ky = y1 + hy fx = x3 - db * Sin(j3) fy = y3 + db * Cos(j3) zzx
48、 = (x1 + x3) / 2 zzy = (y1 + y3) / 2 If pd > 2 * Atn(1) Then p = 12 Else p = 13 End If '当非加工角大于90度时 Select Case p Case 12 If x1 <> x2 Then Text2.Text = pd tana1 = (y2 - y1) / (x2 - x1) b1 = ky - kx * tana1 zya = 1 + tana1 * tana1 zyb = 2 * tana1 * (b1 - ry) - 2 * rx zyc = rx * rx + (b1
49、- ry) * (b1 - ry) - (Sqr(y2 - ry) * (y2 - ry) + (x2 - rx) * (x2 - rx) + kc1 * db) * (Sqr(y2 - ry) * (y2 - ry) + (x2 - rx) * (x2 - rx) + kc1 * db) Call jec(zya, zyb, zyc, jx1, jx2) jy1 = tana1 * jx1 + b1 jy2 = tana1 * jx2 + b1 If (jx1 - x2) * (jx1 - x2) + (jy1 - y2) * (jy1 - y2) < (jx2 - x2) * (jx2 - x2) + (jy2 - y2) * (jy2 - y2) Then jx = jx1 Else jx = jx2 End If jy = tana1 * jx + b1 Else jy1 = (-1) * Sqr(Sqr(y2 - ry) * (y2 - ry) + (x2 - rx) * (x2 - rx) + kc1 * db) * (Sqr(y2 - ry) * (y2 - ry) + (x2 - rx) * (x2 - rx) + kc1
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 业主和房东简单合同范本
- 基于物联网的二零二四年度智能农业解决方案购销合同
- 2024版房地产经纪咨询费合同
- 2024年度福州市二手房买卖合同全文3篇
- 2024年度工程市场调研居间合同3篇
- 麻醉相关课件
- 工程总承包中的联合体协议
- 个人投资简单的协议书范本
- 2024年度云计算服务合同:企业客户与云服务提供商的长期合作协议
- 2024年度租赁合同:办公场所租赁服务3篇
- 单词记忆方法
- 2022年南京市玄武区社区工作者招聘笔试题库及答案解析
- 高校电子课件:珠算教程(第六版)
- 路面施工技术全套课件
- JJF 1321-2011 元素分析仪校准规范-(高清现行)
- 住宅建筑工程施工重点与难点应对措施方案
- 景区玻璃水滑、玻璃滑道项目申请报告可行性研究报告
- 备战2023年新高考英语读后续写高分必备攻略(全国通用)
- 秋季运动会加油稿50字左右100篇
- 水利专业工程师面试题库
- 初中议论文写作讲解通用PPT课件
评论
0/150
提交评论