机械原理大作业(二)凸轮机构设计.doc
机械原理大作业(二)凸轮机构设计(题号:1B)班级:05020402姓名: 学号:时间:2006/12/4一、题目及原始数据:凸轮机构的推杆在近休,推程,远休及回程段的凸轮转角 近休:045° 推程:45°-210° 远休:210°-260° 回程:260°-360°偏置直动滚子推杆盘行凸轮机构已知参数基圆半径 r0=20mm偏距 e=+10mm滚子半径 r1=14mm推杆行程 h=30mm许用压力角 1=30° 2=75°许用最小曲率半径=0.3*14mm二、推杆运动规律及凸轮轮廓曲线方程: 推程: (等加速等减速运动)加速期:s=2h2/02 减速期:S=h-2h(-0)2/02 回程: (余弦加速度运动) s=h1+cos(/0)/2 轮廓线方程:x=(s0+s)*sin+e*cos; y=(s0+s)*cos-e*sin; s0=sqrt(r*r-e*e);三、计算源程序:#include "stdio.h"#include "math.h" #define n 120#define pi 3.1415926#define a pi/180.0main () int r0,r1,h,e,i;double angle0,angle1,angle2,angle3,angle4,angle,angle01,angle02,angle03,angle1m,angle2m,angle3m,angle0m1,angle0m2,rm,r3,r4,r,s,s0,m,m1;float r2,x11,y11,b;double x,x1,x2,y,y1,y2,t,t0,t1,t2;r0=20;r1=14;h=30;e=10;r4=10000;angle1=45*a;angle2=165*a;angle3=50*a;angle4=100*a;angle01=30*a;angle02=75*a;r=1;rm=4.2;angle0m1=-1000;angle0m2=-1000; b=3.1415926*2/n; fp=fopen("zf.txt","w");for (i=0;i<n;i+)s0=sqrt(r0*r0-e*e); angle=i*b; if (angle<=angle1) s=0;m=0;m1=0; if(angle>angle1)&&(angle<(angle1+angle2/2) s=2*h*(angle-angle1)*(angle-angle1)/(angle2*angle2);m=4*h*(angle-angle1)/(angle2*angle2);m1=4*h/(angle2*angle2);else if(angle<=angle1+angle2)&&(angle>=(angle1+angle2/2) s=h-2*h*(angle-angle1-angle2)*(angle-angle1-angle2)/(angle2*angle2);m=4*h*(angle-angle1-angle2)/(angle2*angle2);m1=-4*h/(angle2*angle2); if (angle>(angle1+angle2)&&angle<=(angle1+angle2+angle3) s=h;m=0;m1=0; if (angle>(angle1+angle2+angle3)&&angle<=(angle1+angle2+angle3+angle4) s=h*(1+cos(3.1415926*(angle-angle1-angle2-angle3)/angle4)/2; m=h*(1-3.1415926/angle4*sin(3.1415926*(angle-angle1-angle2-angle3)/angle4)/2; m1=h*(1-3.1415926/angle4*3.1415926/angle4*cos(3.1415926*(angle-angle1-angle2-angle3)/angle4)/2;x=(s0+s)*sin(angle)+e*cos(angle);y=(s0+s)*cos(angle)-e*sin(angle); x1=(m-e)*sin(angle)+(s0+s)*cos(angle);y1=(m-e)*cos(angle)-(s0+s)*sin(angle);x11=(m1-s0-s)*sin(angle)+(2*m-e)*cos(angle);y11=(m1-s0-s)*cos(angle)-(m1+m-e)*sin(angle);t0=sqrt(x1*x1+y1*y1);t1=x1/t0;t2=-y1/t0;x2=x-r1*t2;y2=y-r1*t1; fprintf(fp,"X=%8f,Y=%8f,X'=%8f,Y'=%8frn", x,y,x2,y2,angle);angle0=atan(fabs(m-e)/(s0+s); if(angle>(angle1+angle2+angle3)&&angle<=(angle1+angle2+angle3+angle4) if(angle0>angle02)r0=r0+r; i=0; continue;else if(angle0>angle0m2) angle0m2=angle0; angle2m=angle; else if(angle0>angle01) r0=r0+r; i=0; continue; else if(angle0>angle0m1) angle0m1=angle0; angle1m=angle; t=sqrt(x1*x1+y1*y1); r2=(x1*x1+y1*y1)*t/(x1*y11-x11*y1);if(r2>0) continue;else if(-r2-r1>=rm) r3=-r2; if(r3<r4) r4=r3; angle3m=angle; else r0=r0+r; i=0; continue;fprintf(fp,"angle0m1=%8f,angle1m=%8f,angle0m2=%8f,angle2m=%8frn",angle0m1,angle1m,angle0m2,angle2m ); fprintf(fp,"r4=%8f,angle3m=%8f,r0=%d,rn",r4,angle3m ,r0); fclose(fp);四、计算结果:X理:15.224368 Y理论:34.816930 X实:8.012825 Y实:18.324700 角度:0.034907X理:16.430187 Y理论:34.264398 X实:8.647467 Y实:18.033894 角度:0.069813X理:17.615988 Y理论:33.670120 X实:9.271573 Y实:17.721116 角度:0.104720X理:18.780327 Y理论:33.034820 X实:9.884383 Y实:17.386747 角度:0.139626X理:19.921785 Y理论:32.359272 X实:10.485150 Y实:17.031196 角度:0.174533X理:21.038972 Y理论:30.890773 X实:11.647645 Y实:16.258301 角度:0.244346X理:23.195117 Y理论:30.099611 X实:12.207956 Y实:15.841900 角度:0.279253X理:24.231448 Y理论:29.271777 X实:12.753394 Y实:15.406198 角度:0.314159X理:25.238257 Y理论:28.408280 X实:13.283293 Y实:14.951726 角度:0.349066X理:26.214317 Y理论:27.510172 X实:13.797009 Y实:14.479038 角度:0.383972X理:27.158439 Y理论:26.578547 X实:14.293915 Y实:13.988709 角度:0.418879X理:28.069473 Y理论:25.614540 X实:14.773407 Y实:13.481337 角度:0.453786X理:28.946309 Y理论:24.619326 X实:15.234899 Y实:12.957540 角度:0.488692X理:29.787877 Y理论:23.594117 X实:15.677894 Y实:12.417876 角度:0.523599X理:30.597738 Y理论:22.547499 X实:16.238226 Y实:11.693725 角度:0.558505X理:31.380498 Y理论:21.487419 X实:16.781649 Y实:10.957767 角度:0.593412X理:32.136687 Y理论:20.414132 X实:17.308378 Y实:10.210150 角度:0.628319X理:32.866804 Y理论:19.327822 X实:17.818601 Y实:9.451001 角度:0.663225X理:33.571317 Y理论:18.228604 X实:18.312475 Y实:8.680423 角度:0.698132X理:34.250653 Y理论:17.116533 X实:18.790127 Y实:7.898500 角度:0.733038X理:34.905199 Y理论:15.991601 X实:19.251651 Y实:7.105296 角度:0.767945X理:35.535294 Y理论:14.853745 X实:19.697110 Y实:6.300855 角度:0.802851X理:36.141226 Y理论:13.702849 X实:20.126535 Y实:5.485205 角度:0.837758X理:36.723230 Y理论:12.538747 X实:20.539923 Y实:4.658354 角度:0.872665X理:37.281479 Y理论:11.361229 X实:20.937237 Y实:3.820292 角度:0.907571X理:37.816091 Y理论:10.170047 X实:21.318405 Y实:2.970995 角度:0.942478X理:38.327115 Y理论:8.964915 X实:22.031842 Y实:1.238504 角度:1.012291X理:39.278267 Y理论:6.511511 X实:22.363791 Y实:0.355173 角度:1.047198X理:39.718153 Y理论:5.262536 X实:22.678949 Y实:-0.539666 角度:1.082104X理:40.133964 Y理论:3.998215 X实:22.977064 Y实:-1.446122 角度:1.117011X理:40.525395 Y理论:2.718161 X实:23.257841 Y实:-2.364318 角度:1.151917X理:40.892067 Y理论:1.421981 X实:23.520946 Y实:-3.294393 角度:1.186824X理:41.233521 Y理论:0.109286 X实:23.766004 Y实:-4.236496 角度:1.221730X理:41.549225 Y理论:-1.220309 X实:23.992595 Y实:-5.190790 角度:1.256637X理:41.838566 Y理论:-2.567176 X实:24.200257 Y实:-6.157445 角度:1.291544X理:42.100855 Y理论:-3.931668 X实:24.388482 Y实:-7.136640 角度:1.326450X理:42.335325 Y理论:-5.314117 X实:24.556716 Y实:-8.128557 角度:1.361357X理:42.541133 Y理论:-6.714823 X实:24.704357 Y实:-9.133381 角度:1.396263X理:42.717361 Y理论:-8.134052 X实:24.830754 Y实:-10.151294角度:1.431170X理:42.863017 Y理论:-9.572031 X实:24.935204 Y实:-11.182474角度:1.466077X理:42.977036 Y理论:-11.028939 X实:25.016957 Y实:-12.227089角度:1.500983X理:43.058283 Y理论:-12.504905 X实:25.075207 Y实:-13.285293角度:1.535890X理:43.105554 Y理论:-13.999999 X实:25.109100 Y实:-14.357222角度:1.570796X理:43.117583 Y理论:-15.514232 X实:25.117724 Y实:-15.442991角度:1.605703X理:43.093039 Y理论:-17.047545 X实:25.100120 Y实:-16.542684角度:1.640609X理:43.030531 Y理论:-18.599806 X实:25.055273 Y实:-17.656355角度:1.675516X理:42.928616 Y理论:-20.170809 X实:24.982117 Y实:-18.784019角度:1.710423X理:42.785796 Y理论:-21.760262 X实:24.879535 Y实:-19.925647角度:1.745329X理:42.600528 Y理论:-23.367789 X实:24.746359 Y实:-21.081163角度:1.780236X理:42.371224 Y理论:-24.992923 X实:24.581374 Y实:-22.250433角度:1.815142X理:42.096259 Y理论:-26.635099 X实:24.383318 Y实:-23.433268角度:1.850049X理:41.773975 Y理论:-28.293658 X实:24.150885 Y实:-24.629410角度:1.884956X理:41.402684 Y理论:-29.967833 X实:23.882726 Y实:-25.838535角度:1.919862X理:40.980677 Y理论:-31.656754 X实:23.577457 Y实:-27.060242角度:1.954769X理:40.506228 Y理论:-33.359442 X实:23.233655 Y实:-28.294048角度:1.989675X理:39.977599 Y理论:-35.074804 X实:22.849868 Y实:-29.539388角度:2.024582X理:39.393048 Y理论:-36.801635 X实:22.424617 Y实:-30.795607角度:2.059489X理:38.750832 Y理论:-38.538610 X实:30.996081 Y实:-22.294723角度:2.094395X理:38.034505 Y理论:-40.275093 X实:30.635951 Y实:-23.865906角度:2.129302X理:37.229060 Y理论:-41.998368 X实:30.195071 Y实:-25.429633角度:2.164208X理:36.334928 Y理论:-43.703821 X实:29.673680 Y实:-26.981747角度:2.199115X理:35.352771 Y理论:-45.386865 X实:29.072232 Y实:-28.518112角度:2.234021X理:34.283477 Y理论:-47.042954 X实:28.391390 Y实:-30.034623角度:2.268928X理:33.128164 Y理论:-48.667589 X实:27.632027 Y实:-31.527214角度:2.303835X理:31.888169 Y理论:-50.256336 X实:26.795224 Y实:-32.991867角度:2.338741X理:30.565053 Y理论:-51.804829 X实:25.882264 Y实:-34.424625角度:2.373648X理:29.160590 Y理论:-53.308787 X实:24.894633 Y实:-35.821603角度:2.408554X理:27.676767 Y理论:-54.764018 X实:23.834010 Y实:-37.178990角度:2.443461X理:26.115775 Y理论:-56.166435 X实:22.702269 Y实:-38.493066角度:2.478368X理:24.480008 Y理论:-57.512061 X实:21.501469 Y实:-39.760208角度:2.513274X理:22.772056 Y理论:-58.797042 X实:20.233853 Y实:-40.976899角度:2.548181X理:20.994696 Y理论:-60.017654 X实:18.901839 Y实:-42.139736角度:2.583087X理:19.150889 Y理论:-61.170311 X实:17.508017 Y实:-43.245441角度:2.617994X理:17.243771 Y理论:-62.251576 X实:16.055139 Y实:-44.290865角度:2.652900X理:15.276645 Y理论:-63.258169 X实:14.546115 Y实:-45.272999角度:2.687807X理:13.252975 Y理论:-64.186972 X实:12.984005 Y实:-46.188982角度:2.722714X理:11.176377 Y理论:-65.035040 X实:11.372013 Y实:-47.036103角度:2.757620X理:9.050611 Y理论:-65.799606 X实:9.713475 Y实:-47.811815 角度:2.792527X理:6.879570 Y理论:-66.478087 X实:8.011857 Y实:-48.513735 角度:2.827433X理:4.667275 Y理论:-67.068092 X实:6.270741 Y实:-49.139653 角度:2.862340X理:2.417862 Y理论:-67.567427 X实:4.493819 Y实:-49.687538 角度:2.897247X理:0.135574 Y理论:-67.974100 X实:2.684885 Y实:-50.155542 角度:2.932153X理:-2.175249 Y理论:-68.286327 X实:0.847824 Y实:-50.542004 角度:2.967060X理:-4.510181 Y理论:-68.502536 X实:-1.013396 Y实:-50.845455角度:3.001966X理:-6.864718 Y理论:-68.621368 X实:-2.894735 Y实:-51.064624角度:3.036873X理:-9.234291 Y理论:-68.641684 X实:-4.792090 Y实:-51.198438角度:3.071779X理:-11.614274 Y理论:-68.562570 X实:-6.701303 Y实:-51.246026角度:3.106686X理:-13.999998 Y理论:-68.383332 X实:-8.618173 Y实:-51.206722角度:3.141593X理:-16.386759 Y理论:-68.103506 X实:-10.538466 Y实:-51.080066角度:3.176499X理:-18.769828 Y理论:-67.722852 X实:-12.457925 Y实:-50.865809角度:3.211406X理:-21.144466 Y理论:-67.241362 X实:-14.372278 Y实:-50.563908角度:3.246312X理:-23.505932 Y理论:-66.659256 X实:-16.277251 Y实:-50.174531角度:3.281219X理:-25.849493 Y理论:-65.976983 X实:-18.168578 Y实:-49.698054角度:3.316126X理:-28.170439 Y理论:-65.195221 X实:-20.042008 Y实:-49.135065角度:3.351032X理:-30.464088 Y理论:-64.314875 X实:-21.893321 Y实:-48.486359角度:3.385939X理:-32.725805 Y理论:-63.337076 X实:-23.718330 Y实:-47.752936角度:3.420845X理:-34.951002 Y理论:-62.263178 X实:-25.512901 Y实:-46.936005角度:3.455752X理:-37.135160 Y理论:-61.094758 X实:-27.272952 Y实:-46.036974角度:3.490658X理:-39.273831 Y理论:-59.833608 X实:-28.994473 Y实:-45.057452角度:3.525565X理:-41.362653 Y理论:-58.481737 X实:-30.673528 Y实:-43.999244角度:3.560472X理:-43.397357 Y理论:-57.041364 X实:-32.306269 Y实:-42.864349角度:3.595378X理:-45.373781 Y理论:-55.514913 X实:-33.888943 Y实:-41.654952角度:3.630285X理:-47.287876 Y理论:-53.905008 X实:-35.417601 Y实:-40.373690角度:3.665191X理:-49.140327 Y理论:-52.221847 X实:-36.805047 Y实:-39.113039角度:3.700098X理:-50.932908 Y理论:-50.475062 X实:-38.147651 Y实:-37.804734角度:3.735005X理:-52.663435 Y理论:-48.666781 X实:-39.443779 Y实:-36.450371角度:3.769911X理:-54.329801 Y理论:-46.799207 X实:-40.691850 Y实:-35.051598角度:3.804818X理:-55.929973 Y理论:-44.874616 X实:-41.890345 Y实:-33.610121角度:3.839724X理:-57.462004 Y理论:-42.895352 X实:-43.037803 Y实:-32.127695角度:3.874631X理:-58.924025 Y理论:-40.863826 X实:-44.132826 Y实:-30.606126角度:3.909537X理:-60.314257 Y理论:-38.782514 X实:-45.174080 Y实:-29.047268角度:3.944444X理:-61.631006 Y理论:-36.653952 X实:-46.160296 Y实:-27.453020角度:3.979351X理:-62.872666 Y理论:-34.480732 X实:-47.090273 Y实:-25.825326角度:4.014257X理:-64.037726 Y理论:-32.265503 X实:-47.962878 Y实:-24.166167角度:4.049164X理:-65.124766 Y理论:-30.010963 X实:-48.777047 Y实:-22.477565角度:4.084070X理:-66.132461 Y理论:-27.719860 X实:-49.531789 Y实:-20.761578角度:4.118977X理:-67.059584 Y理论:-25.394984 X实:-50.226184 Y实:-19.020296角度:4.153884X理:-67.905005 Y理论:-23.039168 X实:-50.859387 Y实:-17.255841角度:4.188790X理:-68.667695 Y理论:-20.655283 X实:-51.430625 Y实:-15.470362角度:4.223697X理:-69.346723 Y理论:-18.246232 X实:-51.939202 Y实:-13.666035角度:4.258603X理:-69.941264 Y理论:-15.814951 X实:-52.384500 Y实:-11.845058角度:4.293510X理:-70.450591 Y理论:-13.364403 X实:-52.765975 Y实:-10.009650角度:4.328417X理:-70.874085 Y理论:-10.897571 X实:-53.083164 Y实:-8.162046 角度:4.363323X理:-71.211231 Y理论:-8.417463 X实:-53.335678 Y实:-6.304498 角度:4.398230X理:-71.461616 Y理论:-5.927099 X实:-53.523211 Y实:-4.439270 角度:4.433136X理:-71.624936 Y理论:-3.429514 X实:-53.645535 Y实:-2.568632 角度:4.468043X理:-71.700992 Y理论:-0.927751 X实:-53.702499 Y实:-0.694865 角度:4.502949X理:-71.689692 Y理论:1.575143 X实:-53.694035 Y实:1.179748 角度:4.537856X理:-71.591049 Y理论:4.076118 X实:-53.620154 Y实:3.052924 角度:4.572763X理:-71.405183 Y理论:6.572126 X实:-53.480944 Y实:4.922381 角度:4.607669X理:-71.132321 Y理论:9.060128 X实:-53.276577 Y实:6.785840 角度:4.642576X理:-70.772796 Y理论:11.537091 X实:-53.007300 Y实:8.641032 角度:4.677482X理:-70.327044 Y理论:13.999997 X实:-52.673441 Y实:10.485697 角度:4.712389X理:-69.795610 Y理论:16.445847 X实:-52.275408 Y实:12.317586 角度:4.747296X理:-69.179140 Y理论:18.871661 X实:-51.813686 Y实:14.134467 角度:4.782202X理:-68.478387 Y理论:21.274482 X实:-51.288837 Y实:15.934129 角度:4.817109X理:-67.694203 Y理论:23.651383 X实:-50.701500 Y实:17.714377 角度:4.852015X理:-66.827543 Y理论:25.999469 X实:-48.967984 Y实:23.755335 角度:4.886922X理:-65.826230 Y理论:28.304563 X实:-48.198716 Y实:24.661658 角度:4.921828X理:-64.641138 Y理论:30.545434 X实:-47.354426 Y实:25.528507 角度:4.956735X理:-63.277589 Y理论:32.708746 X实:-46.436309 Y实:26.354907 角度:4.991642X理:-61.742338 Y理论:34.781770 X实:-45.445180 Y实:27.139606 角度:5.026548X理:-60.043499 Y理论:36.752532 X实:-44.381628 Y实:27.880902 角度:5.061455X理:-58.190457 Y理论:38.609954 X实:-43.246217 Y实:28.576525 角度:5.096361X理:-56.193761 Y理论:40.343979 X实:-42.039706 Y实:29.223604 角度:5.131268X理:-54.065005 Y理论:41.945689 X实:-40.763271 Y实:29.818699 角度:5.166175X理:-51.816696 Y理论:43.407404 X实:-39.418688 Y实:30.357907 角度:5.201081X理:-49.462114 Y理论:44.722769 X实:-38.008483 Y实:30.837009 角度:5.235988X理:-47.015156 Y理论:45.886825 X实:-36.536027 Y实:31.251667 角度:5.270894X理:-44.490184 Y理论:46.896056 X实:-35.005558 Y实:31.597628 角度:5.305801X理:-41.901856 Y理论:47.748429 X实:-33.422163 Y实:31.870935 角度:5.340707X理:-39.264965 Y理论:48.443405 X实:-31.791688 Y实:32.068114 角度:5.375614X理:-36.594271 Y理论:48.981938 X实:-30.120610 Y实:32.186351 角度:5.410521X理:-33.904333 Y理论:49.366454 X实:-28.415872 Y实:32.223619 角度:5.445427X理:-31.209352 Y理论:49.600808 X实:-26.684679 Y实:32.178772 角度:5.480334X理:-28.523011 Y理论:49.690231 X实:-24.934287 Y实:32.051606 角度:5.515240X理:-25.858326 Y理论:49.641248 X实:-23.171771 Y实:31.842866 角度:5.550147X理:-23.227508 Y理论:49.461596 X实:-21.403787 Y实:31.554223 角度:5.585054X理:-20.641836 Y理论:49.160111 X实:-19.636335 Y实:31.188218 角度:5.619960X理:-18.111538 Y理论:48.746612 X实:-17.874522 Y实:30.748173 角度:5.654867X理:-15.645690 Y理论:48.231769 X实:-16.122329 Y实:30.238080 角度:5.689773X理:-13.252132 Y理论:47.626960 X实:-14.382380 Y实:29.662480 角度:5.724680X理:-10.937397 Y理论:46.944124 X实:-12.655715 Y实:29.026329 角度:5.759586X理:-8.706659 Y理论:46.195602 X实:-10.941579 Y实:28.334888 角度:5.794493X理:-6.563697 Y理论:45.393977 X实:-9.237212 Y实:27.593631 角度:5.829400X理:-4.510882 Y理论:44.551909 X实:-7.537676 Y实:26.808219 角度:5.864306X理:-2.549177 Y理论:43.681970 X实:-5.835723 Y实:25.984552 角度:5.899213X理:-0.678160 Y理论:42.796486 X实:-4.121776 Y实:25.128959 角度:5.934119X理:1.103938 Y理论:41.907374 X实:-2.384077 Y实:24.248559 角度:5.969026X理:2.800176 Y理论:41.025993 X实:-0.609152 Y实:23.351818 角度:6.003933X理:4.41482