- 积分
- 234
- 明经币
- 个
- 注册时间
- 2003-4-13
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
我用autolisp作了一个圆柱直齿轮校核的程序,但运行的时候,总是不能成功,我找了很久,不知道毛病在那里,请对这方面熟悉的朋友帮帮忙!
源代码:
DCL部分
//直齿圆柱齿轮辅助设计对话框
design:dialog{
label="直齿圆柱齿轮传动设计计算初始环境设定";
:column{
:row{
spacer;
:column{
:row{
:column{
:text{label="小齿轮材料及热处理";}
:popup_list{
label="";
key="xclrcl";
}
}
spacer;
:column{
:text{label="大齿轮材料及热处理";}
:popup_list{
label="";
key="dclrcl";
}
}
}
:row{
:column{
:edit_box{label="硬度HBS";key="yingduhbs";}
:edit_box{label="硬度HRC";key="yingduhrc";}
}
spacer;
:column{
:edit_box{label="硬度HBS";key="yingduhbs2";}
:edit_box{label="硬度HRC";key="yingduhrc2";}
}
}
:radio_row{
label="齿轮相对轴承位置";
key="weizhi";
:radio_button{label="对称";key="duichen";}
:radio_button{label="非对称";key="fduichen";}
:radio_button{label="悬臂";key="xuanbi";}
}
}
spacer;
:column{
:edit_box{label="额定功率(kw):";key="edgonglv";edit_width=10;}
:edit_box{label="小齿轮转速(r/min):";key="zhuansu";edit_width=10;}
:edit_box{label="初始小齿轮齿数z1:";key="chishu";edit_width=10;}
:edit_box{label="齿轮传动比:";key="chuandongbi";edit_width=10;}
:edit_box{label="预期寿命(h):";key="shouming";edit_width=10;}
:popup_list{
label="精度等级";
key="jingdu";
list="2\n3\n4\n5\n6\n7\n8\n9\n19\n11\n12";
value="6";
edit_width=10;
}
}
}
:row{
:boxed_radio_row{
label="工作特性";
:boxed_radio_column{
label="动力机";
key="dongliji";
:radio_button{
label="均匀平稳";
key="junyun";
}
:radio_button{
label="轻微冲击";
key="qingwei";
}
:radio_button{
label="中等冲击";
key="zhongdeng";
}
:radio_button{
label="严重冲击";
key="yanzhong";
}
}
:boxed_radio_column{
label="工作机";
key="gongzuoji";
:radio_button{
label="均匀平稳";
key="jupw";
}
:radio_button{
label="轻微冲击";
key="qwcj";
}
:radio_button{
label="中等冲击";
key="zdcj";
}
:radio_button{
label="严重冲击";
key="yzcj";
}
}
}
:boxed_radio_row{
label="使用要求";
:boxed_radio_column{
label="可靠度";
key="kekaodu";
:radio_button{
label="高可靠度";
key="g";
}
:radio_button{
label="较高可靠度";
key="jg";
}
:radio_button{
label="一般可靠度";
key="yb";
}
:radio_button{
label="低可靠度";
key="d";
}
}
:boxed_radio_column{
label="点蚀";
key="dianshi";
:radio_button{
label="允许有一定点蚀";
key="you";
}
:radio_button{
label="不允许有点蚀";
key="wu";
}
}
}
}
:row{
spacer;
spacer;
children_alignment=centered;
:button{
fixed_width=true;
width=6;
label="计算...";
key="jisuan";
}
ok_cancel;
spacer;
spacer;
}
}
}
//齿轮设计计算对话框
jisuan:dialog{
label="计算...";
:boxed_column{
label="计算结果";
:edit_box{
label="计算小齿轮直径";
key="zhijing";
edit_width=8;
}
:edit_box{
label="初步齿宽";
key="chikuan";
edit_width=8;
}
:edit_box{
label="计算模数";
key="jsmoshu";
edit_width=8;
}
}
:popup_list{
label="请选择标准模数:";
key="moshu";
edit_width=8;
list="1\n1.25\n1.5\n1.75\n2\n2.25\n2.5\n2.75\n3\n3.5\n4\n4.5\n5\n5.5\n6\n7\n8\n9\n10\n12\n14\n16\n18\n20";
}
:row{
:button{
label="校核...";
key="jiaohe";
}
ok_cancel;
}
}
//设计结果输出对话框
shuchu:dialog{
label="您设计的齿轮主要参数";
key="shuchu";
:edit_box{
label="小齿轮分度圆直径:";
key="d1";
edit_width=8;
}
:edit_box{
label="大齿轮分度圆直径:";
key="d2";
edit_width=8;
}
:edit_box{
label="模数:";
key="m";
edit_width=8;
}
:edit_box{
label="齿宽:";
key="b";
edit_width=8;
}
:edit_box{
label="小齿轮齿数:";
key="z1";
edit_width=8;
}
:edit_box{
label="大齿轮齿数:";
key="z2";
edit_width=8;
}
ok_cancel;
}
LSP部分
;支持圆柱齿轮计算机辅助设计主程序.
(defun c:design()
;数值初始化.
(setq p nil) ;p---额定功率.
(setq n1 nil) ;n1---小齿轮转速.
(setq th nil) ;th---预期寿命.
(setq jddj nil) ;jddj---精度等级.
(setq hbs nil) ;hbs---小齿轮HBS
(setq hrc nil) ;hrc---小齿轮HRC
(setq hbs2 nil) ;hbs2---大齿轮HBS
(setq hrc2 nil) ;hrc2---大齿轮HRC
(setq wz nil) ;wz---轴承位置.
(setq dgztx nil) ;dgztx---动力机工作特性.
(setq ggztx nil) ;ggztx---工作机工作特性.
(setq m nil) ;模数m
(setq index_value (load_dialog "design"))
(if (not (new_dialog "design" index_value)) (exit))
(setq m_list (list"45#正火""45#调质""45#表面淬火""42siMn调质""42siMn表面淬火""40MnB调质"
"40MnB表面淬火""35CrMo调质""CrMo表面淬火""40Cr调质""40Cr表面淬火"
"20Cr渗碳淬火+低温回火""20CrMnTi渗碳淬火+低温回火""38CrMoAl调质、渗氮"
"ZG310-570正火""ZG340-640正火""ZG35CrMnSi正火、回火""ZG35CrMnSi调质"
"HT300""HT350""QT500-7""QT600-3""KTZ550-04""KTZ650-02"))
(start_list "xclrcl") ;添加到小齿轮热处理下拉菜单.
(mapcar 'add_list m_list)
(end_list)
(start_list "dclrcl") ;添加到大齿轮热处理下拉菜单.
(mapcar 'add_list m_list)
(end_list)
(mode_tile "yingduhrc" 1)
(mode_tile "yingduhrc2" 1)
(mode_tile "yingduhbs" 0)
(mode_tile "yingduhbs2" 0)
(action_tile "accept" "(done_dialog)")
(action_tile "xclrcl" "(zhihui1)")
(action_tile "dclrcl" "(zhihui2)")
;设定默认值.
(set_tile "xclrcl" "1")
(setq cl1 (get_tile "xclrcl")) ;cl1---小齿轮热处理方式.
(set_tile "dclrcl" "1")
(setq cl2 (get_tile "dclrcl")) ;cl2---大齿轮热处理方式.
;赋值.
(action_tile "edgonglv" "(setq p (atof $value))") ;p---额定功率.
(action_tile "chuandongbi" "(setq i (atof $value))") ;i---传动比.
(action_tile "zhuansu" "(setq n1 (atof $value))") ;n1---小齿轮转速.
(action_tile "shouming" "(setq th (atof $value))") ;th---预期寿命.
(action_tile "jingdu" "(setq jddj $value)") ;jddj---精度等级.
(setq jddj (get_tile "jingdu"))
(action_tile "chishu" "(setq z1 (atof $value))") ;z1---小齿轮齿数.
(set_tile "weizhi" "duichen")
(setq wz (get_tile "weizhi")) ;wz---轴承位置.
(action_tile "weizhi" "(setq wz $value)")
(action_tile "yingduhrc" "(setq hrc (atof $value))") ;hrc---小齿轮HRC
(action_tile "yingduhbs" "(setq hbs (atof $value))") ;hbs---小齿轮HBS
(action_tile "yingduhrc2" "(setq hrc2 (atof $value))") ;hrc2---大齿轮HRC
(action_tile "yingduhbs2" "(setq hbs2 (atof $value))") ;hbs2---大齿轮HBS
(set_tile "dongliji" "qingwei")
(setq dgztx (get_tile "dongliji")) ;dgztx---动力机工作特性.
(action_tile "dongliji" "(setq dgztx $value)")
(set_tile "gongzuoji" "qwcj")
(setq ggztx (get_tile "gongzuoji")) ;ggztx---工作机工作特性.
(action_tile "gongzuoji" "(setq ggztx $value)")
(set_tile "kekaodu" "yb")
(setq kkd (get_tile "kekaodu")) ;kkd---可靠度.
(set_tile "dianshi" "you")
(setq dsh (get_tile "dianshi"))
(action_tile "dianshi" "(setq dsh $value)") ;dsh---点蚀.
(action_tile "jisuan" "(jinggao1)")
(start_dialog)
(unload_dialog index_value)
)
;警告对话框1(当输入值不完整时)
(defun jinggao1()
(if (or (= p nil) (= n1 nil) (= i nil) (= th nil)
(and (= hbs nil) (= hrc nil))
(and (= hrc2 nil) (= hbs2 nil))
)
(alert "请输入完整的初始值") (jisuanjieguo)
)
)
;警告对话框2(当没有选择标准模数时)
(defun jinggao2()
(if (= m nil) (alert "请选择标准模数") (jiaohejieguo1))
)
;隐藏函数1
(defun zhihui1()
(setq cl1 (get_tile "xclrcl"))
(setq w 10) ;??????????
(if (or (= "2" cl1) (= "4" cl1) (= "6" cl1) (= "8" cl1)
(= "10" cl1) (= "11" cl1) (= "12" cl1))
(and (mode_tile "yingduhbs" 1) (mode_tile "yingduhrc" 0) (setq hbs nil))
(and (mode_tile "yingduhbs" 0) (mode_tile "yingduhrc" 1) (setq hrc nil))
)
)
;隐藏函数2
(defun zhihui2()
(setq cl2 (get_tile "dclrcl"))
(if (or (= "2" cl2) (= "4" cl2) (= "6" cl2) (= "8" cl2)
(= "10" cl2) (= "11" cl2) (= "12" cl2))
(and (mode_tile "yingduhbs2" 1) (mode_tile "yingduhrc2" 0)
(setq hbs2 nil)
)
(and (mode_tile "yingduhbs2" 0) (mode_tile "yingduhbs2" 1)
(setq hrc2 nil)
)
)
)
;计算程序.
(defun jisuanjieguo()
(if (not (new_dialog "jisuan" index_value)) (exit))
(setq t1 nil) ;t1---小齿轮转距.
(setq qd nil) ;qd---齿宽系数.?????
(setq ohlim1 nil) ;ohlim1---小齿轮接触疲劳极限.
(setq ohlim2 nil) ;ohlim2---大齿轮接触疲劳极限.
(setq oh1 nil) ;oh1---小齿轮接触疲劳许用应力.
(setq oh2 nil) ;oh2---大齿轮接触疲劳许用应力.
(setq d1 nil) ;d1---小齿轮分度圆直径d1
(setq b nil) ;b---齿宽.
(setq v nil) ;v---圆周速度.
(setq z2 nil) ;z2---大齿轮齿数.
(setq m nil) ;m---模数.
(setq mj nil) ;mj---???????
;确定小齿轮转距t1
(setq t1 (/ (* 9.55 1000000 p) n1))
;确定齿宽系数qd
(setq qd (cond ((and (= wz "duichen") (= hrc nil)) 1.0)
((and (= wz "fduichen") (= hrc nil)) 0.8)
((and (= wz "xuanbi") (= hrc nil)) 0.35)
((and (= wz "duichen") (= hbs nil)) 0.6)
((and (= wz "fduichen") (= hbs nil)) 0.4)
((and (= wz "xuanbi") (= hbs nil)) 0.2)
)
)
;确定小齿轮接触疲劳极限ohlim1
(setq ohlim1 (cond ((= cl1 "0") (+ (* 0.985 hbs) 203.2))
((= cl1 "1") (+ hbs 348.3))
((or (= cl1 "2") (= cl1 "4") (= cl1 "6") (= cl1 "8")
(= cl1 "10")) (+ (* 12 hrc) 550))
((or (= cl1 "3") (= cl1 "5") (= cl1 "7") (= cl1 "9")) (+ (* 1.33 hbs) 366.7))
((or (= cl1 "11") (= cl1 "12")) 1500)
((= cl1 "13") 1000)
((or (= cl1 "14") (= cl1 "15") (= cl1 "16")) (+ (* 0.974 hbs) 140.5))
((= cl1 "17") (+ hbs 348.3))
((or (= cl1 "18") (= cl1 "19")) (+ (* 1.024 hbs) 138.7))
((or (= cl1 "20") (= cl1 "21")) (+ (* 1.41 hbs) 215.4))
((or (= cl1 "22") (= cl1 "23")) (+ (* 1.43 hbs) 148.5))
)
)
;确定小齿轮接触疲劳极限ohlim2
(setq ohlim1 (cond ((= cl1 "0") (+ (* 0.985 hbs) 203.2))
((= cl1 "1") (+ hbs 348.3))
((or (= cl1 "2") (= cl1 "4") (= cl1 "6") (= cl1 "8")
(= cl1 "10")) (+ (* 12 hrc) 550))
((or (= cl1 "3") (= cl1 "5") (= cl1 "7") (= cl1 "9")) (+ (* 1.33 hbs) 366.7))
((or (= cl1 "11") (= cl1 "12")) 1500)
((= cl1 "13") 1000)
((or (= cl1 "14") (= cl1 "15") (= cl1 "16")) (+ (*0.974 hbs) 140.5))
((= cl1 "17") (+ hbs 348.3))
((or (= cl1 "18") (= cl1 "19")) (+ (* 1.024 hbs) 138.7))
((or (= cl1 "20") (= cl1 "21")) (+ (* 1.41 hbs) 215.4))
((or (= cl1 "22") (= cl1 "23")) (+ (* 1.43 hbs) 148.5))
)
)
;确定接触疲劳许用应力.
(setq oh1 (* 0.9 ohlim1))
(setq oh2 (* 0.9 ohlim2))
(setq oh (min oh1 oh2)) ;oh---接触疲劳许用应力中较小值.
;计算分度圆直径??????????????????????????????
(setq ad 85.0)
(setq d1 (* ad (expt (/ (* t1 (+ i 1)) qd oh oh i)(/ 1.0 3))))
(setq v (/ (* pi d1 n1) 60.0 1000)) ;计算圆周速度.
(setq b (+ 1 (fix (* qd d1)))) ;计算齿宽.
(setq z2 (fix (* i z1))) ;z2---大齿轮齿数.
(setq mj (/ d1 z1)) ;mj---计算模数.
(set_tile "zhijing" (rtos d1 2 2))
(set_tile "chikuan" (itoa b))
(set_tile "jsmoshu" (rtos mj 2 2))
(mode_tile "jsmoshu" 1)
(mode_tile "zhijing" 1)
(mode_tile "chikuan" 1)
(action_tile "accept" "(done_dialog)")
(action_tile "jiaohe" "(jinggao2)")
(if (> oh ohlim) (action_tile "jiaohe" "(jiaohejieguo1)"))
(if (or (> of11 of1) (> of22 of2)) (action_tile "jiaohe" "(jiaohejieguo1)"))
(action_tile "moshu" "(yizhi)")
(start_dialog)
)
(defun jiaohejieguo1()
(setq z1 nil) ;z1---小齿轮齿数.
(setq z2 nil) ;z2---大齿轮齿数.
(setq ka nil) ;ka---使用系数.
(setq ft nil) ;ft---圆周力.
(setq x nil) ;x---ka*ft/b
(setq ea nil) ;ea---???????????
(setq kha nil) ;kha---齿间载荷分布系数.
(setq khb nil) ;knb---齿向载荷分布系数.
(setq k nil) ;k---载荷系数.
(setq ze1 nil) ;ze1---弹性影响系数.
(setq z1 (fix (/ d1 m)))
(setq z2 (fix (* i z1)))
;确定使用系数ka
(setq ka (cond ((and (= dgztx "junyun") (= ggztx "jupw")) 1.00)
((and (= dgztx "junyun") (= ggztx "qwcj")) 1.25)
((and (= dgztx "junyun") (= ggztx "zdcj")) 1.50)
((and (= dgztx "junyun") (= ggztx "yzcj")) 1.75)
((and (= dgztx "qingwei") (= ggztx "jupw")) 1.10)
((and (= dgztx "qingwei") (= ggztx "qwcj")) 1.35)
((and (= dgztx "qingwei") (= ggztx "zdcj")) 1.60)
((and (= dgztx "qingwei") (= ggztx "yzcj")) 1.85)
((and (= dgztx "zhongdeng") (= ggztx "jupw")) 1.25)
((and (= dgztx "zhongdeng") (= ggztx "qwcj")) 1.50)
((and (= dgztx "zhongdeng") (= ggztx "zdcj")) 1.75)
((and (= dgztx "zhongdeng") (= ggztx "yzcj")) 2.00)
((and (= dgztx "yanzhong") (= ggztx "jupw")) 1.50)
((and (= dgztx "yanzhong") (= ggztx "qwcj")) 1.75)
((and (= dgztx "yanzhong") (= ggztx "zdcj")) 2.00)
((and (= dgztx "yanzhong") (= ggztx "yzcj")) 2.25)
)
)
;确定动载系数kv
(setq kv (cond ((= jddj "4") (+ (- (* 2.29 (expt 10.0 -6) (expt v 3))
(* 2.43 (expt 10.0 -4) v v))
(* 9.922 (expt 10.0 -2) v) 1.0257))
((= jddj "5") (+ (- (* 5.376 (expt 10.0 -6) (expt v 3))
(* 4.58 (expt 10.0 -4) v v))
(* 1.67 (expt 10.0 -3) v) 1.058))
((= jddj "6") (+ (- (* 1.967 (expt 10.0 -5) (expt v 3))
(* 1.236 (expt 10.0 -3) v v))
(* 3.18 (expt 10.0 -2) v) 1.063))
((= jddj "7") (+ (- (* 3.0 (expt 10.0 -5) (expt v 3))
(* 1.8 (expt 10.0 -3) v v))
(* 4.44 (expt 10.0 -2) v) 1.08))
)
)
(if (or (= jddj "0") (= jddj "1") (= jddj "2") (= jddj "3")) (setq kv 1.0)
(setq kv 1.5)
)
;齿间载荷分配系数kha
(setq ft (/ (* 2.0 t1) d1))
(setq x (/ (* ka ft) b))
(setq ea (- 1.88 (* 3.2 (+ (/ 1.0 z1) (/ 1.0 z2)))))
(setq ze (sqrt (/ 4.0 ea) 3.0))
(if (>= x 100) (setq kha (if (=hrc nil) (cond ((or (= jddj "0")
(= jddj "1")
(= jddj "2")
(= jddj "8")
(= jddj "9")
(= jddj "10"))
(/ 1.0 ze ze))
((= jddj "3") 1.0)
((= jddj "4") 1.0)
((= jddj "5") 1.0)
((= jddj "6") 1.1)
((= jddj "7") 1.2)
)
(cond ((or (= jddj "0") (= jddj "1")
(= jddj "2") (= jddj "7")
(= jddj "8") (= jddj "9")
(= jddj "10"))
(/ 1.0 ze ze))
((= jddj "3") 1.0)
((= jddj "4") 1.0)
((= jddj "5") 1.1)
((= jddj "6") 1.2)
)
)
)
(setq kha (/ 1.0 ze ze))
)
;齿向载荷分配系数khb
(if (= hrc nil) (setq khb (cond ((and (= jddj "4") (= wz "duichen"))
(+ 1.04 (* 0.16 qd qd)
(* 0.15 (expt 10.0 -3) b)))
((and (= jddj "4") (= wz "fduichen"))
(+ 1.04 (* 0.16 qd qd (+ 1.0 (* 0.6 qd qd)))
(* 0.15 (expt 10.0 -3) b)))
((and (= jddj "4") (= wz "xuanbi"))
(+ 1.04 (* 0.16 qd qd (+ 1.0 (* 6.7 qd qd)))
(* 0.15 (expt 10.0 -3) b)))
((and (= jddj "5") (= wz "duichen"))
(+ 1.05 (* 0.16 qd qd)
(* 0.23 (expt 10.0 -3) b)))
((and (= jddj "5") (= wz "fduichen"))
(+ 1.05 (* 0.16 qd qd (+ 1.0 (* 0.6 qd qd)))
(* 0.23 (expt 10.0 -3) b)))
((and (= jddj "5") (= wz "fduichen"))
(+ 1.05 (* 0.16 qd qd (+ 1.0 (* 6.7 qd qd)))
(* 0.23 (expt 10.0 -3) b)))
((and (= jddj "6") (= wz "duichen"))
(+ 1.09 (* 0.16 qd qd)
(* 0.31 (expt 10.0 -3) b)))
((and (= jddj "6") (= wz "fduichen"))
(+ 1.09 (* 0.16 qd qd (+ 1.0 (* 0.6 qd qd)))
(* 0.31 (expt 10.0 -3) b)))
((and (= jddj "6") (= wz "fduichen"))
(+ 1.09 (* 0.16 qd qd (+ 1.0 (* 6.7 qd qd)))
(* 0.31 (expt 10.0 -3) b)))
((or (= jddj "0") (= jddj "1") (= jddj "2")
(= jddj "3") (= jddj "7") (= jddj "8")
(= jddj "9") (= jddj "10"))
1.0)
)
)
)
(if (= hbs nil) (setq khb (cond ((and (= jddj "3") (= wz "duichen"))
(+ 1.05 (* 0.26 qd qd)
(* 0.10 (expt 10.0 -3) b)))
((and (= jddj "3") (= wz "fduichen"))
(+ 1.05 (* 0.26 qd qd (+ 1.0 (* 0.6 qd qd)))
(* 0.1 (expt 10.0 -3) b)))
((and (= jddj "3") (= wz "xuanbi"))
(+ 1.05 (* 0.26 qd qd (+ 1.0 (* 6.7 qd qd)))
(* 0.1 (expt 10.0 -3) b)))
((and (= jddj "4") (= wz "duichen"))
(+ 1.05 (* 0.26 qd qd)
(* 0.16 (expt 10.0 -3) b)))
((and (= jddj "4") (= wz "fduichen"))
(+ 1.05 (* 0.26 qd qd (+ 1.0 (* 0.6 qd qd)))
(* 0.16 (expt 10.0 -3) b)))
((and (= jddj "4") (= wz "xuanbi"))
(+ 1.05 (* 0.26 qd qd (+ 1.0 (* 6.7 qd qd)))
(* 0.16 (expt 10.0 -3) b)))
((or (= jddj "0") (= jddj "1") (= jddj "2")
(= jddj "5") (= jddj "6") (= jddj "7")
(= jddj "8") (= jddj "9") (= jddj "10"))
1.0)
)
)
)
(if (and (= hbs nil) (> khb 1.34))
(setq khb (cond ((and (= jddj "3") (= wz "duichen"))
(+ 0.99 (* 0.31 qd qd)
(+ 0.12 (expt 10.0 -3) b)))
((and (= jddj "3") (= wz "fduichen"))
(+ 0.99 (* 0.31 qd qd (+ 1.0 (* 0.6 qd qd)))
(* 0.12 (expt 10.0 -3) b)))
((and (= jddj "3") (= wz "xuanbi"))
(+ 0.99 (* 0.31 qd qd (+ 1.0 (* 6.7 qd qd)))
(* 0.12 (expt 10.0 -3) b)))
((and (= jddj "4") (= wz "duichen"))
(+ 1.0 (* 0.31 qd qd)
(+ 0.19 (expt 10.0 -3) b)))
((and (= jddj "4") (= wz "fduichen"))
(+ 1.0 (* 0.31 qd qd (+ 1.0 (* 0.6 qd qd)))
(* 0.19 (expt 10.0 -3) b)))
((and (= jddj "4") (= wz "xuanbi"))
(+ 1.0 (* 0.31 qd qd (+ 1.0 (* 6.7 qd qd)))
(* 0.19 (expt 10.0 -3) b)))
)
)
)
(setq k (* ka kv kha khb))
;确定弹性影响系数ze
(setq ze1 (cond ((and (or (= cl1 "0") (= cl1 "1") (= cl1 "2") (= cl1 "3") (= cl1 "4")
(= cl1 "5") (= cl1 "6") (= cl1 "7") (= cl1 "8") (= cl1 "9")
(= cl1 "10") (= cl1 "11") (= cl1 "12") (= cl1 "13")
)
(or (= cl2 "0") (= cl2 "1") (= cl2 "2") (= cl2 "3") (= cl2 "4")
(= cl2 "5") (= cl2 "6") (= cl2 "7") (= cl2 "8") (= cl2 "9")
(= cl2 "10") (= cl2 "11") (= cl2 "12") (= cl2 "13")
)
)
189.8
)
((and (or (= cl1 "0") (= cl1 "1") (= cl1 "2") (= cl1 "3") (= cl1 "4")
(= cl1 "5") (= cl1 "6") (= cl1 "7") (= cl1 "8") (= cl1 "9")
(= cl1 "10") (= cl1 "11") (= cl1 "12") (= cl1 "13")
)
(or (= cl2 "14") (= cl2 "15") (= cl2 "16") (= cl2 "17"))
)
188.9
)
((and (or (= cl1 "0") (= cl1 "1") (= cl1 "2") (= cl1 "3") (= cl1 "4")
(= cl1 "5") (= cl1 "6") (= cl1 "7") (= cl1 "8") (= cl1 "9")
(= cl1 "10") (= cl1 "11") (= cl1 "12") (= cl1 "13")
)
(or (= cl2 "18") (= cl2 "19") (= cl2 "22") (= cl2 "23"))
)
163.0
)
((and (or (= cl1 "0") (= cl1 "1") (= cl1 "2") (= cl1 "3") (= cl1 "4")
(= cl1 "5") (= cl1 "6") (= cl1 "7") (= cl1 "8") (= cl1 "9")
(= cl1 "10") (= cl1 "11") (= cl1 "12") (= cl1 "13")
)
(or (= cl2 "20") (= cl2 "21"))
)
181.4
)
((and (or (= cl1 "14") (= cl1 "15") (= cl1 "16") (= cl1 "17"))
(or (= cl2 "14") (= cl2 "16") (= cl2 "17") (= cl2 "17"))
)
188.0
)
((and (or (= cl1 "14") (= cl1 "15") (= cl1 "16") (= cl1 "17"))
(or (= cl2 "20") (= cl2 "21"))
)
180.5
)
((and (or (= cl1 "14") (= cl1 "15") (= cl1 "16") (= cl1 "17"))
(or (= cl2 "18") (= cl2 "19") (= cl2 "22") (= cl2 "23"))
)
161.4
)
((and (or (= cl1 "14") (= cl1 "15") (= cl1 "16") (= cl1 "17"))
(or (= cl2 "0") (= cl2 "1") (= cl2 "2") (= cl2 "3") (= cl2 "4")
(= cl2 "5") (= cl2 "6") (= cl2 "7") (= cl2 "8") (= cl2 "9")
(= cl2 "10") (= cl2 "11") (= cl2 "12") (= cl2 "13")
)
)
(alert "此组合的齿轮副没有弹性系数,重新选择材料")
)
((and (or (= cl1 "20") (= cl1 "21"))
(or (= cl2 "20") (= cl2 "21"))
)
173.9
)
((and (or (= cl1 "20") (= cl1 "21"))
(or (= cl2 "18") (= cl2 "19") (= cl2 "22") (= cl2 "23"))
)
156.6
)
((and (or (= cl1 "20") (= cl1 "21"))
(or (= cl2 "0") (= cl2 "1") (= cl2 "2") (= cl2 "3") (= cl2 "4")
(= cl2 "5") (= cl2 "6") (= cl2 "7") (= cl2 "8") (= cl2 "9")
(= cl2 "10") (= cl2 "11") (= cl2 "12") (= cl2 "13")
)
)
(alert "此组合的齿轮副没有弹性系数,重新选择材料")
)
((and (or (= cl1 "20") (= cl1 "21"))
(or (= cl2 "14") (= cl2 "15") (= cl2 "16") (= cl2 "17"))
)
(alert "此组合的齿轮副没有弹性系数,重新选择材料")
)
((and (or (= cl1 "18") (= cl1 "19") (= cl1 "22") (= cl1 "23"))
(or (= cl2 "18") (= cl2 "19") (= cl2 "22") (= cl2 "23"))
)
145.7
)
((and (or (= cl1 "18") (= cl1 "19") (= cl1 "22") (= cl1 "23"))
(or (= cl2 "0") (= cl2 "1") (= cl2 "2") (= cl2 "3") (= cl2 "4")
(= cl2 "5") (= cl2 "6") (= cl2 "7") (= cl2 "8") (= cl2 "9")
(= cl2 "10") (= cl2 "11") (= cl2 "12") (= cl2 "13")
)
)
(alert "此组合的齿轮副没有弹性系数,重新选择材料")
)
((and (or (= cl1 "18") (= cl1 "19") (= cl1 "22") (= cl1 "23"))
(or (= cl2 "20") (= cl2 "21"))
)
(alert "此组合的齿轮副没有弹性系数,重新选择材料")
)
((and (or (= cl1 "18") (= cl1 "19") (= cl1 "22") (= cl1 "23"))
(or (= cl2 "14") (= cl2 "15") (= cl2 "16") (= cl2 "17"))
)
(alert "此组合的齿轮副没有弹性系数,重新选择材料")
)
)
)
;求应力循环次数
(setq zh 2.5) ;zh---??????????????
(setq shmin nil) ;shmin---安全系数.
(setq nl1 nil) ;nl1---小齿轮应力循环系数
(setq nl2 nil) ;nl2---大齿轮应力循环系数
(setq zn1 nil) ;zn1---小齿接触疲劳寿命系数.
(setq zn2 nil) ;zn2---大齿接触疲劳寿命系数
(setq shmin (cond ((= shyyq "g") 1.55) ;shyyq---使用要求
((= shyyq "jg") 1.275)
((= shyyq "yb") 1.05)
((= shyyq "d") 0.85)
)
)
(setq nl1 (* 60.0 1.0 n1 th))
(setq nl2 (/ nl1 i))
(if (and (= dsh "you") (or (= cl1 "0") (= cl1 "1") (= cl1 "2")
(= cl1 "3") (= cl1 "5") (= cl1 "7")
(= cl1 "9") (= cl1 "13") (= cl1 "20")
(= cl1 "21") (= cl1 "22") (= cl1 "23")
(= cl1 "4") (= cl1 "6") (= cl1 "8")
(= cl1 "10") (= cl1 "14") (= cl1 "15")
(= cl1 "16") (= cl1 "17")
)
)
(setq zn1 (cond ((<= nl1 (* 6 (expt 10 5))) 1.6)
((and (> nl1 (* 6 (expt 10 5))) (<= nl1 (expt 10 7)))
(expt (/ (* 3 (expt 10 6)) nl1) 0.0756))
((and (> nl1 (expt 10 7)) (<= nl1 (expt 10 9)))
(expt (/ (expt 10 9) nl1) 0.057))
((and (> nl1 (expt 10 9)) (<= nl1 (expt 10 10)))
(expt (/ (expt 10 9) nl1) 0.0706))
((> nl1 (expt 10 10)) (alert "应力循环次数大于10**10无效"))
)
)
)
(if (and (= dsh "wu") (or (= cl1 "0") (= cl1 "1") (= cl1 "2") (= cl1 "3")
(= cl1 "5") (= cl1 "7") (= cl1 "9") (= cl1 "13")
(= cl1 "20") (= cl1 "21") (= cl1 "22") (= cl1 "23")
(= cl1 "4") (= cl1 "6") (= cl1 "8") (= cl1 "10")
(= cl1 "14") (= cl1 "15") (= cl1 "16") (= cl1 "17")
)
)
(setq zn1 (cond ((<= nl1 (expt 10 5)) 1.6)
((and (> nl1 (expt 10 5)) (<= nl1 (* 5 (expt 10 7))))
(expt (/ (* 5 (expt 10 7)) nl1) 0.0756))
((and (> nl1 (* 5 (expt 10 7))) (<= nl1 (expt 10 10))))
(expt (/ (* 5 (expt 10 7)) nl1 0.0306))
((> nl1 (expt 10 10)) (alert "应力循环次数大于10**10无效"))
)
)
)
(if (or (= cl1 "11") (= cl1 "12") (= cl1 "18") (= cl1 "19"))
(setq zn1 (cond ((<= nl1 (expt 10 5)) 1.3)
((and (> nl1 (expt 10 5)) (<= nl1 (* 2 (expt 10 6))))
(expt (/ (* 2 (expt 10 6)) nl1) 0.0875))
((and (> nl1 (* 2 (expt 10 6))) (<= nl1 (expt 10 10)))
(expt (/ (* 2 (expt 10 6)) nl1) 0.0191))
((> nl1 (expt 10 10)) (alert "应力循环次数大于10**10无效"))
)
)
)
(if (and (= dsh "you") (or (= cl2 "0") (= cl2 "1") (= cl2 "2") (= cl2 "3")
(= cl2 "5") (= cl2 "7") (= cl2 "9") (= cl2 "13")
(= cl2 "20") (= cl2 "21") (= cl2 "22") (= cl2 "23")
(= cl2 "4") (= cl2 "6") (= cl2 "8") (= cl2 "10")
(= cl2 "14") (= cl2 "15") (= cl2 "16") (= cl2 "17")
)
)
(setq zn2 (cond ((<= nl2 (* 6 (expt 10 5))) 1.6)
((and (> nl2 (* 6 (expt 10 5))) (<= nl2 (expt 10 7)))
(expt (/ (* 3 (expt 10 6)) nl2) 0.0756))
((and (> nl2 (expt 10 9)) (<= nl2 (expt 10 10)))
(expt (/ (expt 10 9) nl2) 0.0706))
((> nl2 (Expt 10 10)) (alert "应力循环次数大于10**10无效"))
)
)
)
(if (and (= dsh "wu") (or (= cl2 "0") (= cl2 "1") (= cl2 "2") (= cl2 "3")
(= cl2 "5") (= cl2 "7") (= cl2 "9") (= cl2 "13")
(= cl2 "20") (= cl2 "21") (= cl2 "22") (= cl2 "23")
(= cl2 "4") (= cl2 "6") (= cl2 "8") (= cl2 "10")
(= cl2 "14") (= cl2 "15") (= cl2 "16") (= cl2 "17")))
(setq zn2 (cond ((<= nl2 (expt 10 5)) 1.6)
((and (> nl2 (expt 10 5)) (<= nl2 (* 5 (expt 10 7))))
(expt (/ (* 5(expt 10 7)) nl2) 0.0756))
((and (> nl2 (* 5 (expt 10 7))) (<= nl2 (expt 10 10)))
(expt (/ (* 5(expt 10 7)) nl2) 0.0306))
((> nl2 (expt 10 10)) (alert "应力循环次数大于10**10无效"))
)
)
)
(if (or (= cl2 "11") (= cl2 "12") (= cl2 "18") (= cl2 "19"))
(setq zn2 (cond ((<= nl2 (expt 10 5)) 1.3)
((and (> nl2 (expt 10 5)) (<= nl2 (* 2 (expt 10 6))))
(expt (/ (* 2 (expt 10 6)) nl2) 0.0875))
((and (> nl2 (* 2 (expt 10 6))) (<= nl2 (expt 10 10)))
(expt (/ (* 2 (expt 10 6)) nl2) 0.0191))
((> nl2 (expt 10 10)) (alert "应力循环次数大于10**10无效"))
)
)
)
;齿面疲劳强度计算
(setq oh1 nil)
(setq oh2 nil)
(setq oh nil)
(setq ohmin nil)
(setq oh1 (/ (* ohmin zn1) shmin))
(setq oh2 (/ (* ohmin zn2) shmin))
(setq oh (* ze zh ze1 (sqrt (/ (* 2.0 k t1 (+ i 1)) b d1 d1 i)))) ;zh---区域系数
(setq ohmin (min oh1 oh2))
(if (< oh ohmin) (jiaohejieguo2) (alert "对不起,请重新调整尺寸"))
)
;齿跟弯曲疲劳强度计算
(defun jiaohejieguo2()
(setq ye nil)
(setq kfa nil)
(setq kfb1 nil)
(setq ye (+ 0.25 (/ 0.75 ea)))
(if (>= x 100)
(setq kfa (if (= hrc nil) (cond ((or (= jddj "0") (= jddj "1") (= jddj "2")
(= jddj "8") (= jddj "9") (= jddj "10"))
(/ 1.0 ye))
((= jddj "3") 1.0)
((= jddj "4") 1.0)
((= jddj "5") 1.0)
((= jddj "6") 1.1)
((= jddj "7") 1.2)
)
(cond ((or (= jddj "0") (= jddj "1") (= jddj "2")
(= jddj "7") (= jddj "8") (= jddj "9")
(= jddj "10"))
(/ 1.0 ye))
((= jddj "3") 1.0)
((= jddj "4") 1.0)
((= jddj "5") 1.1)
((= jddj "6") 1.2)
)
)
)
(setq kfa (/ 1.0 ye))
)
(setq kfb1 (/ b (* 2.25 m)))
(setq kfb nil)
(setq k1 nil)
(setq yfa1 nil) ;yfa1---齿型系数
(setq yfa2 nil) ;yfa2---齿型系数
(setq ysa1 nil) ;ysa1---应力校正系数
(setq ysa2 nil) ;ysa2---应力校正系数
(setq oflim1 nil)
(setq oflim2 nil)
(setq kfb (cond ((> kfb1 12) khb)
((and (> kfb1 9) (<= kfb1 12)) (+ (* 0.893 khb) 0.107))
((and (> kfb1 5) (<= kfb1 9)) (+ (* 0.794 khb) 0.207))
((and (> kfb1 3.5) (<= kfb1 5)) (+ (* 0.66 khb) 0.3445))
((<= kfb1 3.5) (+ (* 0.595 khb) 0.407))
)
)
(setq k1 (* ka kv kfa kfb))
(setq yfa1 (- (+ 3.7966 (* 0.000928 z1 z1)) (* 0.066 z1) (* 4.31 0.000001 z1 z1 z1)))
(setq yfa2 (- (+ 3.7966 (* 0.000928 z2 z2)) (* 0.066 z2) (* 4.31 0.000001 z1 z1 z1)))
(setq ysa1 (- (+ 1.472047 (* 0.00497 z1)) (* 0.000016 z1 z1)))
(setq ysa2 (- (+ 1.472047 (* 0.00497 z2)) (* 0.000016 z2 z2)))
(setq oflim1 (cond ((= cl1 "0") (+ (* 0.75 hbs) 187.5))
((or (= cl1 "14") (= cl1 "15") (= cl1 "16")) (+ (* 0.5 hbs) 175))
((or (= cl1 "20") (= cl1 "21")) (+ (* 0.75 hbs) 187.5))
((or (= cl1 "22") (= cl1 "23")) (+ (* 0.667 hbs) 250))
((or (= cl1 "18") (= cl1 "19")) (+ (* 0.54 hbs) 11.3))
((or (= cl1 "3") (= cl1 "5") (= cl1 "7") (= cl1 "9") (= cl1 "13"))
(+ (* 0.844 hbs) 377.9))
((= cl1 "1") (+ (* 0.44 hbs) 331.7))
((= cl1 "17") (+ (* 0.76 hbs) 341.7))
((and (or (= cl1 "11") (= cl1 "12")) (>= hrc 32)) 920.7)
((and (or (= cl1 "11") (= cl1 "12")) (< hrc 32)) 854.54)
((and (or (= cl1 "2") (= cl1 "4") (= cl1 "6") (= cl1 "8")
(= cl1 "10")
)
(<= hrc 55)) (+ (* 2.346 hrc) 605.628))
((and (or (= cl1 "2") (= cl1 "4") (= cl "6") (= cl1 "8")
(= cl1 "10")
)
(> hrc 55)) 734.48)
)
)
(setq oflim2 (cond ((= cl2 "0") (+ (* 0.75 hbs2) 187.5))
((or (= cl2 "14") (= cl2 "15") (= cl2 "16")) (+ (* 0.5 hbs2) 175))
((or (= cl2 "20") (= cl2 "21")) (+ (* 0.75 hbs2) 187.5))
((or (= cl2 "22") (= cl2 "23")) (+ (* 0.667 hbs2) 250))
((or (= cl2 "18") (= cl2 "19")) (+ (* 0.54 hbs2) 11.3))
((or (= cl2 "3") (= cl2 "5") (= cl2 "7") (= cl2 "9")
(= cl2 "13"))
(+ (* 0.844 hbs2) 377.9))
((= cl2 "1") (+ (* 0.44 hbs2) 331.7))
((= cl2 "17") (+ (* 0.76 hbs2) 314.7))
((and (or (= cl2 "11") (= cl2 "12")) (>= hrc2 32)) 920.7)
((and (or (= cl2 "11") (= cl2 "12")) (< hrc 32)) 854.54)
((and (or (= cl2 "2") (= cl2 "4") (= cl2 "6") (= cl2 "8")
(= cl2 "10"))
(<= hrc2 55)) (+ (* 2.346 hrc2) 605.628))
((and (or (= cl2 "2") (= cl2 "4") (= cl2 "6") (= cl2 "8")
(= cl2 "10"))
(> hrc2 55)) 734.8)
)
)
(setq sfmin nil)
(setq yn1 nil)
(setq yn2 nil)
(setq yx nil)
(setq sfmin (cond ((= shyyq "g") 2.00)
((= shyyq "jg") 1.60)
((= shyyq "yb") 1.25)
((= shyyq "d") 1.00)
)
)
(if (or (= cl1 "1") (= cl1 "3") (= cl1 "5") (= cl1 "7") (= cl1 "9") (= cl1 "13")
(= cl1 "14") (= cl1 "15") (= cl1 "16") (= cl1 "17") (= cl1 "20")
(= cl1 "21") (= cl1 "22") (= cl1 "23"))
(setq yn1 (cond ((<= nl1 (expt 10 4)) 2.5)
((and (> nl1 (expt 10 4)) (<= nl1 (* 3 (expt 10 10))))
(expt (/ (* 3 (expt 10 6)) nl1) 0.16))
((and (> nl1 (* 3 (expt 10 6))) (<= nl1 (expt 10 10)))
(expt (/ (* 3 (expt 10 6)) nl1) 0.02))
((> nl1 (expt 10 10)) (alert "应力循环次数大于10**10,无效"))
)
)
)
(if (or (= cl1 "2") (= cl1 "4") (= cl1 "6") (= cl1 "8") (= cl1 "10"))
(setq yn1 (cond ((<= nl1 (expt 10 3)) 2.5)
((and (> nl1 (expt 10 3)) (<= nl1 (expt 10 10)))
(expt (/ (* 3 (expt 10 6)) nl1) 0.115))
((and (> nl1 (* 3 (expt 10 6))) (<= nl1 (expt 10 10)))
(expt (/ (* 3 (expt 10 6)) nl1) 0.02))
((> nl1 (expt 10 10))
(alert "应力循环次数大于10**10,无效"))
)
)
)
(if (or (= cl1 "2") (= cl1 "4") (= cl1 "6") (= cl1 "8") (= cl1 "10"))
(setq yn1 (cond ((<= nl1 (expt 10 3)) 2.5)
((and (> nl1 (expt 10 3)) (<= nl1 (* 3 (expt 10 6))))
(expt (/ (* 3 (expt 10 6)) nl1) 0.115))
((and (> nl1 (* (expt 10 6))) (<= nl1 (expt 10 10)))
(expt (/ (* 3 (expt 10 6)) nl1) 0.02))
((> nl1 (expt 10 10))
(alert "应力循环次数大于10**10,无效"))
)
)
)
(if (or (= cl1 "0") (= cl1 "11") (= cl1 "12") (= cl1 "18") (= cl1 "19"))
(setq yn1 (cond ((<= nl1 (expt 10 3)) 1.6)
((and (> nl1 (expt 10 3)) (<= nl1 (* 3 (expt 10 6))))
(expt (/ (* 3 (expt 10 6)) nl1) 0.05))
((and (> nl1 (* 3 (expt 10 6))) (<= nl1 (expt 10 10)))
(expt (/ (* 3 (expt 10 6)) nl1) 0.02))
((> nl1 (expt 10 10))
(alert "应力循环次数大于10**10,无效"))
)
)
)
(if (or (= cl2 "1") (= cl2 "3") (= cl2 "5") (= cl2 "7") (= cl2 "9") (= cl2 "13")
(= cl2 "14") (= cl2 "15") (= cl2 "16") (= cl2 "17") (= cl2 "20")
(= cl2 "21") (= cl2 "22") (= cl2 "23"))
(setq yn2 (cond ((<= nl2 (expt 10 4)) 2.5)
((and (> nl2 (expt 10 4)) (<= nl2 (* 3 (expt 10 6))))
(expt (/ (* 3 (expt 10 6)) nl2) 0.06))
((and (> nl2 (* 3 (expt 10 6))) (<= nl2 (expt 10 10)))
(expt (/ (* 3 (expt 10 6)) nl2) 0.02))
((> nl2 (expt 10 10)) (alert "应力循环次数大于10**10,无效"))
)
)
)
(if (or (= cl2 "2") (= cl2 "4") (= cl2 "6") (= cl2 "8") (= cl2 "10"))
(setq yn2 (cond ((<= nl2 (expt 10 3)) 2.5)
((and (> nl2 (expt 10 3)) (<= nl2 (expt 10 10)))
(expt (/ (* 3 (expt 10 6)) nl2) 0.115))
((and (> nl2 (* 3 (expt 10 6))) (<= nl2 (expt 10 10)))
(expt (/ (* 3 (expt 10 6)) nl2) 0.02))
((> nl2 (expt 10 10)) (alert "应力循环次数大于10**10,无效"))
)
)
)
(if (or (= cl2 "0") (= cl2 "11") (= cl2 "18") (= cl2 "19"))
(setq yn2 (cond ((<= nl2 (expt 10 3)) 1.6)
((and (> nl2 (expt 10 3)) (<= nl2 (* 3 (expt 10 6))))
(expt (/ (* 3 (expt 10 6)) nl2) 0.05))
((and (> nl2 (* 3 (expt 10 6))) (<= nl2 (expt 10 10)))
(expt (/ (* 3 (expt 10 6)) nl2) 0.02))
((> nl2 (expt 10 10)) (alert "应力循环次数大于10**10,无效"))
)
)
)
(if (or (= cl1 "0") (= cl1 "1") (= cl1 "3") (= cl1 "5") (= cl1 "7") (= cl1 "9")
(= cl1 "13") (= cl1 "14") (= cl1 "15") (= cl1 "17") (= cl1 "20")
(= cl1 "21") (= cl1 "21") (= cl1 "22") (= cl1 "23"))
(cond ((<= m 5) (setq yx 1.0))
((and (> m 5) (< m 30)) (setq yx (- 0.025 (* 0.006 m))))
((>= m 30) (setq yx 0.85))
)
)
(if (or (= cl1 "2") (= cl1 "4") (= cl1 "6") (= cl1 "8") (= cl1 "10")
(= cl1 "11") (= cl1 "12"))
(cond ((<= m 5) (setq yx 1.0))
((and (> m 5) (< m 30)) (setq yx(- 1.05 (* 0.01 m))))
((>= m 30) (setq yx 0.75))
)
)
(if (or (= cl1 "18") (= cl1 "19"))
(cond ((<= m 5) (setq yx 1.0))
((and (> m 5) (< m 25)) (setq yx (- 1.075 (* 0.015 m))))
((>= m 25) (setq yx 0.7))
)
)
;???????????????????/
(setq of1 nil)
(setq of2 nil)
(setq of11 nil)
(setq of22 nil)
(setq of1 (/ (* oflim1 yn1 yx) sfmin))
(setq of2 (/ (* oflim2 yn2 yx) sfmin))
(setq of11 (/ (* 2 k1 t1 yfa1 ysa1 ye) b d1 m))
(setq of22 (/ (* of11 yfa2 ysa2) yfa1 ysa1))
(if (and (< of11 of1) (< of22 of2)) (alert "祝贺你,你设计的尺寸合格")
(alert "弯曲强度不合格,请重新调整尺寸"))
(if (and (< of11 of1) (< of22 of2) (< oh ohmin)) (jieguoshuchu))
)
(defun jieguoshuchu()
(if (not (new_dialog "shuchu" index_value)) (exit))
(action_tile "accept" "(done_dialog)")
(setq d2 (* m z2))
(set_tile "d1" (rtos d1 2 2))
(set_tile "d2" (rtos d2 2 2))
(set_tile "b" (rtos b))
(set_tile "m" (rtos m 2 2))
(set_tile "z1" (itoa z1))
(set_tile "z2" (itoa z2))
(start_dialog)
)
谢谢了!
如果有问题,请与我联系
QQ:18816820
EMAIL:leicn@sohu.com
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|