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

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2883|回復: 10
收起左側

arduino+moc33021+bta16為什么啥只有半波控制,求大佬解疑

[復制鏈接]
ID:633947 發表于 2019-11-1 17:54 | 顯示全部樓層 |閱讀模式
void up()
{
  digitalWrite(12, HIGH);
  delayMicroseconds(5000);
  digitalWrite(12, LOW);
  delayMicroseconds(1000);
  digitalWrite(12, HIGH);
}

void setup() {
  pinMode(2, INPUT);
  pinMode(12, OUTPUT);
  // put your setup code here, to run once:
  attachInterrupt(0, up, RISING);
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(100);
}

這個是arduino代碼,檢測到過零后延時5ms控制moc3021開通。

不知道為什么只有在220v的負半波能開通可控硅,正的半波一點反應都沒有,可控硅觸發電路是參考的moc3021手冊推薦電路,是不是proteus仿真元件有問題?moc3021?bta16-600bw?


51hei截圖20191101174505.jpg
51hei截圖20191101174746.jpg

Arduino 328.rar

92.11 KB, 下載次數: 12

proteus項目文件

回復

使用道具 舉報

ID:633947 發表于 2019-11-4 09:37 | 顯示全部樓層
沒有人嗎?
回復

使用道具 舉報

ID:342822 發表于 2019-11-4 10:31 | 顯示全部樓層

這是Proteus 8 中的例程看一看吧
/* Main.ino file generated by New Project wizard
*
* Created:   mer ago 22 2018
* Processor: Arduino Uno
* Compiler:  Arduino AVR
*/

int AC_LOAD = 3;    // Output to Opto Triac pin
int dimming = 128;  // Dimming level (0-128)  0 = ON, 128 = OFF

void setup()
{
  pinMode(AC_LOAD, OUTPUT);// Set AC Load pin as output
  attachInterrupt(0, zero_crosss_int, RISING);  // Choose the zero cross interrupt # from the table above
}

//the interrupt function must take no parameters and return nothing
void zero_crosss_int()  //function to be fired at the zero crossing to dim the light
{
  // Firing angle calculation : 1 full 50Hz wave =1/50=20ms
  // Every zerocrossing thus: (50Hz)-> 10ms (1/2 Cycle)
  // For 60Hz => 8.33ms (10.000/120)
  // 10ms=10000us
  // (10000us - 10us) / 128 = 75 (Approx) For 60Hz =>65

  int dimtime = (75*dimming);    // For 60Hz =>65   
  delayMicroseconds(dimtime);    // Wait till firing the TRIAC
  digitalWrite(AC_LOAD, HIGH);   // Fire the TRIAC
  delayMicroseconds(10);         // triac On propogation delay (for 60Hz use 8.33)
  digitalWrite(AC_LOAD, LOW);    // No longer trigger the TRIAC (the next zero crossing will swith it off) TRIAC
}

void loop()  {
  for (int i=5; i <= 128; i++){
    dimming=i;
    delay(10);
   }
}
回復

使用道具 舉報

ID:342822 發表于 2019-11-4 10:51 | 顯示全部樓層
檢測到過零后延時5ms控制moc3021開通????
用10ms試一試~~
回復

使用道具 舉報

ID:633947 發表于 2019-11-4 14:33 | 顯示全部樓層
taotie 發表于 2019-11-4 10:31
這是Proteus 8 中的例程看一看吧
/* Main.ino file generated by New Project wizard
*

這個例子名稱叫什么,我想看看完整項目
回復

使用道具 舉報

ID:633947 發表于 2019-11-4 14:44 | 顯示全部樓層
可以看到單片機觸發信號應該是沒問題的,但是只有負半波可控硅開通了
51hei截圖20191104095454.jpg
回復

使用道具 舉報

ID:342822 發表于 2019-11-4 16:24 | 顯示全部樓層
jzli2019 發表于 2019-11-4 14:33
這個例子名稱叫什么,我想看看完整項目

Arduino Dimming 230V AC
回復

使用道具 舉報

ID:342822 發表于 2019-11-4 17:12 | 顯示全部樓層
按你的程序仿真沒得問題。。
捕獲.PNG

回復

使用道具 舉報

ID:633947 發表于 2019-11-4 18:02 | 顯示全部樓層
taotie 發表于 2019-11-4 17:12
按你的程序仿真沒得問題。。

大佬,我把proteus8.7卸載了重新裝了proteus8.9,現在模擬也沒問題了。。。很莫名其妙啊
回復

使用道具 舉報

ID:633947 發表于 2019-11-4 18:03 | 顯示全部樓層
taotie 發表于 2019-11-4 17:12
按你的程序仿真沒得問題。。

你用的是哪個版本,我感覺就是版本不對導致的。。。
回復

使用道具 舉報

ID:342822 發表于 2019-11-5 13:01 | 顯示全部樓層
jzli2019 發表于 2019-11-4 18:03
你用的是哪個版本,我感覺就是版本不對導致的。。。

呵呵8.8
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表