欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標(biāo)題: 電渦流傳感器實(shí)現(xiàn)金屬檢測(cè) 同厚金屬板材質(zhì)分辨單片機(jī)源碼與仿真 [打印本頁(yè)]

作者: tianxianyan    時(shí)間: 2018-4-8 21:07
標(biāo)題: 電渦流傳感器實(shí)現(xiàn)金屬檢測(cè) 同厚金屬板材質(zhì)分辨單片機(jī)源碼與仿真
用電渦流傳感器+51單片機(jī)來(lái)實(shí)現(xiàn)的金屬檢測(cè)原件清單:


同厚金屬板材質(zhì)分辨的proteus仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)


單片機(jī)源程序如下:
  1. #include <STC15F2K60S2.H>
  2. #include <ADC.h>
  3. #include <math.h>
  4. #define IRON         93
  5. #define        COPPER        86
  6. #define ALUM        84
  7. sbit get_init=P0^0;
  8. sbit switch_mode=P0^1;
  9. sbit resolution=P0^2;
  10. //數(shù)碼管變量區(qū)
  11. unsigned char code Table[]={
  12. 0x3f,0x06,0x5b,0x4f,
  13. 0x66,0x6d,0x7d,0x07,
  14. 0x7f,0x6f,0x77,0x7c,
  15. 0x39,0x5e,0x79,0x71};
  16. unsigned char code Wei_Table[]={
  17. 0xef,0xdf,0xbf,0x7f};
  18. unsigned char Screen_Table[4],wei;

  19. unsigned char number=0;        //物質(zhì)編號(hào)
  20. unsigned char standard,current,texture;
  21. void Delay50ms()                //@11.0592MHz
  22. {
  23.         unsigned char i, j, k;

  24.         _nop_();
  25.         _nop_();
  26.         i = 3;
  27.         j = 26;
  28.         k = 223;
  29.         do
  30.         {
  31.                 do
  32.                 {
  33.                         while (--k);
  34.                 } while (--j);
  35.         } while (--i);
  36. }
  37. void Timer0Init(void)                //2毫秒@11.0592MHz
  38. {
  39.         AUXR &= 0x7F;                //定時(shí)器時(shí)鐘12T模式
  40.         TMOD &= 0xF0;                //設(shè)置定時(shí)器模式
  41.         TL0 = 0xCD;                //設(shè)置定時(shí)初值
  42.         TH0 = 0xF8;                //設(shè)置定時(shí)初值
  43.         TF0 = 0;                //清除TF0標(biāo)志
  44.         TR0 = 1;                //定時(shí)器0開(kāi)始計(jì)時(shí)
  45.         ET0 = 1;
  46.         EA  = 1;
  47. }

  48. void main()
  49. {
  50.         ADC_Init();
  51.         Timer0Init();
  52.         Screen_Table[0]=0;
  53.         P2M1=0x00;
  54.         P2M0=0xff;
  55.         while(1)
  56.         {
  57.                 if(get_init==0)                                   //獲取無(wú)介質(zhì)時(shí)初始值
  58.                 {
  59.                         standard=GetADC(0);
  60.                         P31=0;                                        //獲取成功標(biāo)志
  61.                 }
  62.                 if(resolution==0)                        //獲取介質(zhì)值并運(yùn)算
  63.                 {
  64.                         current=GetADC(0);
  65.                         texture=(unsigned char)(((float)current*100/standard));
  66.                         if(texture>90)
  67.                                 Screen_Table[1]=Screen_Table[0];
  68.                         else if(texture>85)       
  69.                                 Screen_Table[2]=Screen_Table[0];
  70.                         else if(texture>80)       
  71.                                 Screen_Table[3]=Screen_Table[0];
  72.                 }
  73.                 if(switch_mode==0)                         //設(shè)置被檢測(cè)物體編號(hào)
  74.                 {
  75.                         Delay50ms();
  76.                         if(switch_mode==0)
  77.                         {
  78.                                 Screen_Table[0]=number;
  79.                                 number++;
  80.                                 if(number==4)
  81.                                         number=0;
  82.                                 while(switch_mode==0);
  83.                                 Delay50ms();
  84.                                 while(switch_mode==0);
  85.                         }
  86.                 }                                       
  87.         }
  88. }
  89. ……………………

  90. …………限于本文篇幅 余下代碼請(qǐng)從51黑下載附件…………
復(fù)制代碼

所有資料51hei提供下載:
金屬材質(zhì)檢測(cè)-.zip (93.16 KB, 下載次數(shù): 96)



作者: admin327    時(shí)間: 2019-5-30 21:07
這個(gè)用的全部電路圖在哪里
作者: admin327    時(shí)間: 2019-5-30 21:08
求大神解答一下啊
作者: yyzf998    時(shí)間: 2020-6-3 16:30
不錯(cuò)的思路。好好學(xué)習(xí)了,謝謝樓主!




歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1