1平面六杆机构的运动分析成绩指导老师董海军班级05010804学号2008301212张学振2008301201黄永祥2008301189罗春琦21、题目说明如上图所示平面六杆机构,试用计算机完成其运动分析。已知其尺寸参数如下表所示:组号L1L2L2’L3L4L5L6αxGyG1-A26.5105.665.067.587.534.425.0600153.541.7题目要求:三人一组计算出原动件从0到360时(计算点数37)所要求的各运动变量的大小,并绘出运动曲线图及轨迹曲线。32、题目分析1)建立封闭图形:L1+L2=L3+L4L1+L2=L5+L6+AG2)机构运动分析a、角位移分析由图形封闭性得:55662'2221155662'222113322114332211sinsin)sin(sinsincoscos)cos(coscossinsinsincoscoscosLLyLLLLLxLLLLLLLLLLGGb、角速度分析上式对时间求一阶导数,可得速度方程:0coscos)cos(cos0sinsin)sin(sincoscoscossinsinsin66655522'233366655522'2333111333222111333222LLLLLLLLLLLLLL4化为矩阵形式为:00cossincoscoscos)cos(sinsinsin)sin(00coscos00sinsin1111165326655332'26655332'233223322LLLLLLLLLLLLLLc、角加速度分析:矩阵对时间求一阶导数,可得加速度矩阵为:2233222333'223355665'22335566622332233'22sinsin00coscos00sin()sinsinsincos()coscoscoscoscos00sinsin00cos(LLLLLLLLLLLLLLLLL211221123123355665'2223355666cossin)coscoscos0sin()sinsinsin0LLLLLLLLLd、E点的运动状态位移:55665566sinsincoscosLLyyLLxxGEGE速度:555666555666coscossinsinLLvLLvyxEE5加速度:5552555666266655525556662666cossincossinsincossincosLLLLaLLLLayxEE3、源程序#includemath.h#includestdio.h#includeagaus.c#includednetn.c#includeconio.h#defineAlpha(PI/3)/**/#definePI3.14159265358979#defineAngle(PI/180)#definew11.0#definexg153.5#defineyg41.7intk=100;6doublet=0.1;doubleh=0.1;doubleeps=0.0000001;intm;intjiaodu;/**/doublel[7]={65.0,26.5,105.6,67.5,87.5,34.4,25.0};doublea[4][4];doubleb[4];doublec[4];doublee[6];doublexx[2];FILE*fp;FILE*pf;main(){intn,i,j;doublex[4]={26.23*Angle,49.75*Angle,87.16*Angle,37.25*Angle};fp=fopen(数据结果.txt,w);pf=fopen(数据结果2.txt,w);printf(每段第一行为各杆角度,第二行为各杆角速度,第三行为各杆角加速度,\n各杆顺序为l1,l2,l3,l5,l6\n第四行为E点的位置,E点速度,E点的加速度。E点各值分别指向X和y方向\n);for(m=0;m=35;m++){7jiaodu=m*10;/**/i=dnetn(4,eps,t,h,x,k);/*调用牛顿法求各杆位置,存放在x[0]~~x[3]中*/printf(%f:,jiaodu*Angle);/**/fprintf(fp,%ld\t%lf\t,jiaodu,jiaodu*Angle);a[0][0]=l[2]*sin(x[0]);/*第一次赋值,求角速度*/a[0][1]=-l[3]*sin(x[1]);a[0][2]=0;a[0][3]=0;a[1][0]=l[2]*cos(x[0]);a[1][1]=-l[3]*cos(x[1]);a[1][2]=0;a[1][3]=0;a[2][0]=-l[0]*sin(x[0]-Alpha);a[2][1]=-l[3]*sin(x[1]);a[2][2]=-l[5]*sin(x[2]);a[2][3]=l[6]*sin(x[3]);a[3][0]=l[0]*cos(x[0]-Alpha);a[3][1]=l[3]*cos(x[1]);a[3][2]=l[5]*cos(x[2]);a[3][3]=-l[6]*cos(x[3]);b[0]=-l[1]*sin(jiaodu*Angle)*w1;b[1]=-l[1]*cos(jiaodu*Angle)*w1;8b[2]=0;b[3]=0;for(i=0;i=3;i++){printf(%f,x[i]);fprintf(fp,%lf\t,x[i]);}printf(\n);if(agaus(a,b,4)!=0)/*调用高斯法求各杆角速度,存放在b[0]~~b[3]中*/{printf();for(j=0;j=3;j++){printf(%f,b[j]);fprintf(fp,%lf\t,b[j]);}}printf(\n);a[0][0]=l[2]*sin(x[0]);/*第一次赋值,求角速度*/a[0][1]=-l[3]*sin(x[1]);9a[0][2]=0;a[0][3]=0;a[1][0]=l[2]*cos(x[0]);a[1][1]=-l[3]*cos(x[1]);a[1][2]=0;a[1][3]=0;a[2][0]=l[0]*sin(x[0]-Alpha);a[2][1]=l[3]*sin(x[1]);a[2][2]=l[5]*sin(x[2]);a[2][3]=-l[6]*sin(x[3]);a[3][0]=l[0]*cos(x[0]-Alpha);a[3][1]=l[3]*cos(x[1]);a[3][2]=l[5]*cos(x[2]);a[3][3]=-l[6]*cos(x[3]);c[0]=l[3]*cos(x[1])*b[1]*b[1]-l[1]*cos(jiaodu*Angle)*w1*w1-l[2]*cos(x[0])*b[0]*b[0];c[1]=l[1]*sin(jiaodu*Angle)*w1*w1+l[2]*sin(x[0])*b[0]*b[0]-l[3]*sin(x[1])*b[1]*b[1];c[2]=-l[3]*cos(x[1])*b[1]*b[1]-l[0]*cos(x[0]-Alpha)*b[0]*b[0]-l[5]*cos(x[2])*b[2]*b[2]+l[6]*cos(x[3])*b[3]*b[3];c[3]=l[3]*sin(x[1])*b[1]*b[1]+l[0]*sin(x[0]-Alpha)*b[0]*b[0]+l[5]*sin(x[2])*b[2]*b[2]-l[6]*sin(x[3])*b[3]*b[3];if(agaus(a,c,4)!=0)/*调用高斯法求各杆角jia速度,存放在b[0]~~b[3]中*/10{printf();for(j=0;j=3;j++){printf(%f,c[j]);fprintf(fp,%lf\t,c[j]);}}printf(\n);/*fprintf(fp,\n);*/e[0]=l[6]*cos(x[3])-l[5]*cos(x[2])+xg;e[1]=l[6]*sin(x[3])-l[5]*sin(x[2])+yg;e[2]=-l[6]*sin(x[3])*b[3]+l[5]*sin(x[2])*b[2];e[3]=l[6]*cos(x[3])*b[3]-l[5]*cos(x[2])*b[2];e[4]=-l[6]*cos(x[3])*b[3]*b[3]-l[6]*sin(x[3])*c[3]+l[5]*cos(x[2])*b[2]*b[2]+l[5]*sin(x[2])*c[2];e[5]=-l[6]*sin(x[3])*b[3]*b[3]+l[6]*cos(x[3])*c[3]+l[5]*sin(x[2])*b[2]*b[2]-l[5]*cos(x[2])*c[2];printf(E:X=%fY=%f,e[0],e[1]);printf(E:Vx=%fVy=%f\n,e[2],e[3]);printf(E:ax=%fay%f,e[4],e[5]);fprintf(fp,%lf\t%lf\t,e[0],e[1]);11fprintf(fp,%lf\t%lf\t,e[2],e[3]);fprintf(fp,%lf\t%lf\t,e[4],e[5]);xx[0]=sqrt(e[2]*e[2]+e[3]*e[3]);/*E点的速度绝对值*/fprintf(pf,%ld\t,jiaodu);fprintf(pf,%lf\t,xx[0]);xx[1]=sqrt(e[4]*e[4]+e[5]*e[5]);/*E点的加速度绝对值*/fprintf(pf,%lf\t,xx[1]);fprintf(pf,\n);printf(\n);printf(\n);/*fprintf(fp,\n);*/fprintf(fp,\n);}}voiddnetnf(x,y,n)intn;doublex[],y[];{y[0]=l[2]*cos(x[0])-l[3]*cos(x[1])+l[1]*cos(m*10*Angle)-l[4];y[1]=l[2]*sin(x[0])-l[3]*sin(x[1])+l[1]*sin(m*10*Angle);y[2]=l[3]*cos(x[1])+l[0]*cos(x[0]-Alpha)+l[5]*cos(x[2])-l[6]*cos(x[3])+l[4]-xg;12y[3]=l[3]*sin(x[1])+l[0]*sin(x[0]-Alpha)+l[5]*sin(x[2])-l[6]*sin(x[3])-yg;n=n;return;}4、曲线图:131415E点的位移图:16E点的速度图:17E点速度与原动件角位移关系18E点的加速度图:1920E点加速度与原动件角位移关系图: