确定透镜焦面的系统设计

确定透镜焦面的系统设计

焦面判读程序:

#include<stdio.h>
#include<math.h>

void main()

{
 float f = 100.0; // 阀值
 int min = 1; // 系统所能分辨的最小沿轴移动量,对于1Um的步进电机,则为1Um
 int M = N = 0; //循环次数,本程序中最大为10
 float e,d,aver = 0; //averd的平均值
 int z ;
 float a [10];
 float f_see = 50.864;//待测透镜焦距的目测值
 int b = 10 ;//显微镜物镜放大率
tag:        //程序返回入口
 z = 0;
 while ( z-10 <0) 
    { 
     d = a[z] = sub_programe();// sub_programe()用来求解d
     z++;
    }
 for ( int i = 0;i < 10 ; i++) aver = aver + a[i];
 aver = aver / 10 ;//求得d的平均值
 if ( N == 1)
    {
     if ( d => x) r++;
     goto tag;
    }
 else {  
        e = 4/5 * b/l * d * min/f ;//计算e
        if( abs(d - x) < e)
          { 
            if (a[N] == 2 * min)
          }
        else
          {
            if (d - x < e)
              {  
                 if (M > 0)
                    {
                      if ( d => x) r = r - a[N - 1]; 

                      goto tag ;

                     }
                 else 
                    { 
                     if ( d => x) r = r + a[N -1]/2; 
                     goto tag ;
                    }
              }
            else 
              {
                M++;
                if ( d => x) r = r - a[N -1]/2; 
                goto tag ;
              }
printf("%f",d);//输出d

}  890  

[1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有