機(jī)械精度實(shí)驗(yàn)_第1頁
機(jī)械精度實(shí)驗(yàn)_第2頁
機(jī)械精度實(shí)驗(yàn)_第3頁
機(jī)械精度實(shí)驗(yàn)_第4頁
機(jī)械精度實(shí)驗(yàn)_第5頁
已閱讀5頁,還剩10頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、Calculating flatness with least square method1. Matlab code:clcclearA=xlsread('flatness',1; for i=1:size(A,1 for j=1:size(A,2 if isnan(A(i,j A(i,j=0;endendend x,y,z=find(A; t=x,y; b=regress(z,t; X,Y=meshgrid(1:size(A,1,1:size(A,2; mesh(X,Y,b(1*X+b(2*Y; hold on plot3(x,y,z,'k.'maxval,

2、maxind=max(z-(b(1*x+b(2*y; e=abs(maxval+abs(minval; 2.Graph of regressed plant and related points: 3 The numerical value of flatness (The conclusion calculate by matlab, the flatness is 11.5120 m The conclusion with least square method matches the result in jpg (The conclusion calculate with softwar

3、e, which is also 11.5120 m Calculating flatness with Maximum straightness method clear clc A=xlsread('flatness',1;a=;b=;for i=1:size(A,1flag1=1;flag2=1;for j=2:size(A,2-1ifany(isnan(A(i,j=0 && any(isnan(A(i,j-1a=a,j; flag1=0; end if any(isnan(A(i,j=0 && any(isnan(A(i,j+1b=b,j

4、; flag2=0; end end if flag1a=a 1; endif flag2b=b,size(A,2;end endk=;f=;j=1;for i=1:size(A,1 k=k,(A(i,b(j-A(i,a(j/(b(j-a(j; maxval,maxind=max(A(i,a(j:b(j-myfun(a(j:b(j,k(j,b(j,A(i,b(j; minval,minind=min(A(i,a(j:b(j-myfun(a(j:b(j,k(j,b(j,A(i,b(j; f=f,abs(maxval+abs(minval; j=j+1;endf_final=max(f; The

5、conclusion with this method is: (The mallab gives a result which is 7.215 umCalculating straightness with least square method1. Codeclcclear A=xlsread( e=; for i=1:2:3 a=A(i,:' b=A(i+1,:' d=regress(b,a;figure plot(a,c,'r',a,b,'b',100,'k'. .;enda=A(10,1:16'b=A(11,1

6、:16' d=regress(b,a;maxval,maxind=max(b'-c; minval,minind=min(b'-c; figure plot(a,c,'r',a,b,'b',100,'k'. . ; e=e abs(maxval+abs(minval;2. The numerical value of straightnessAccording to Matlab:e =0.0337 0.0312 0.0375 for three lines respectively.3.Theplot of three

7、lines with related zone and curve:(The plot of first line (The plot of second line (The plot of third line II AB Straightness=AB+0=0.0312um II AB Straightness=AB+0=0.0375um IABI BCStraightness=AB+BC=0.0337umCalculate straightness with two end points method1. Codeclearclc A=xlsread('straightness.

8、xls',1; f=;for i=1:2:3 a=A(i,:; b=A(i+1,:; k=(b(1-b(length(b/(a(1-a(length(b; c=k*(a-a(1*ones(1,length(b+b(1*ones(1,length(b; maxval,maxind=max(b-c;minval,minind=min(b-c;figureplot(a,c,'r',a,b,'b',a(maxind*ones(1,100,linspace(c(maxind,b(maxind,100,'k'. ,a(minind*ones(1,10

9、0,linspace(b(minind,c(minind,100,'c'. ,a,(k*(a-a(maxind*ones(1,length(b+b(maxind*ones(1,length(b,'m'. ,a,(k*(a-a(minind*ones(1,length(b+b(minind*ones(1,length(b,'y'f=f abs(maxval+abs(minval; enda=A(10,1:16;b=A(11,1:16;k=(b(1-b(length(b/(a(1-a(length(b;c=k*(a-a(1*ones(1,length

10、(b+b(1*ones(1,length(b;maxval,maxind=max(b-c;minval,minind=min(b-c; figure plot(a,c,'r',a,b,'b',a(maxind*ones(1,100,linspace(c(maxind,b(maxind,100,'k'. ,a(minind*ones(1,100,linspace(b(minind,c(minind,100,'c'.,a,(k*(a-a(maxind*ones(1,length(b+b(maxind*ones(1,length(b,&

11、#39;m'.,a,(k*(a-a(minind*ones(1,length(b+b(minind*ones(1,length(b,'y'f=f abs(maxval+abs(minval;2.The numerical value of straightnessAccording to matlab: f =0.0226 0.0287 0.0333 for three lines separately.3.Theplot of three lines with related zone and curve:Import data from excel, and sav

12、e it as A Calculate the inclines with two and points. And define lines with then. Finally calculate the vertical intercepts. Plot graph containing all required information. Save the straightness in F Save the straightness in F These process is a repeating of preceding steps. ( No need to payattentio

13、n toIIIIII ABStraightness=AB+0=0.0226um ABABStraightness=AB+0=0.0287umStraightness=AB+0=0.0333umCalculating cylindricity with regressive circle method clc,clear;A=xlsread('cgroup4_1.CSV'B=xlsread('cgroup4_2.CSV'C=xlsread('cgroup4_3.CSV'D=xlsread('cgroup4_4.CSV' n=leng

14、th(X(:,1;y=ones(n,1;b=rand(1*1000 rand(1 rand(1;fun=inline('X(:,1.2+X(:,2.2+a(1*X(:,1+a(2*X(:,2+a(3','a','X'a,r,J = nlinfit(X,y,fun,b ;vpa(a,10 ;X1 =-a(1/2;Y1 =-a(2/2;R =sqrt(a(12+a(22-4*a(3/2;X1=ones(n,1*X1;Y1=ones(n,1*Y1;maxval=max(sqrt(X(:,1-X1.2+(X(:,2-Y1.2;minval=min(sqr

15、t(X(:,1-X1.2+(X(:,2-Y1.2;R1=maxval-minval;The graph of cylinder:Calculating roughness with least squareRead the x,y coordinatefrom excels for differentheight and save then onA,B,C,D respectivelyProject all data to oneplane and regress all datato a specific circle.Find the Radius, centralcoordinates

16、of regressed circle.Find the difference ofdistance between largestand smallest points fromcentral pointmethod1.Programing code clc;clear; A=xlsread('roughness.xlsx'z=find(isnan(A(:,3; for i=length(z:-1:1 A(z(i,:=;end Z=A(:,3; t=A(:,1,A(:,2,ones(size(A,1,1;b=regress(Z,t; f=abs(b(1*A(:,1+b(2*A

17、(:,2-Z+b(3*ones(size(A,1,1/sqrt(b(12+b(22+(-12;Ra=mean(f;plot3(A(:,1,A(:,2,Z,'k.'hold on X,Y=meshgrid(0:700,0:700; mesh(X,Y,b(1*X+b(2*Y+b(3*ones(size(X,1,size(X,2The conclusion:The Ra found by this method is:Ra= 0.1634 um, which matches the conclusion calculated by software: 3.The graph of regressed plane and measured points: Impo

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論