Summary of AC zero-crossing detection circuit


There are many zero-crossing detection schemes for alternating current, and the most common one is the one I used before, as shown in Figure 1:

 
Figure 1 AC optocoupler zero-crossing detection circuit

The circuit in Figure 1 can detect the time when the alternating current passes through the zero point, but it has many drawbacks, which are listed as follows:
  1. The resistor consumes too much power and generates more heat. 220V AC, calculated according to the effective value of the three 47K resistors, the average power of each resistor is 220^2/(3*47k)/3=114.42mw. For the 0805 chip resistor, it is calculated according to the power of 1/8w, the current power consumption is close to its rated power, and the resistor heats up greatly. At the same time, it should be noted that the effective value of the mains is 220V, and its peak voltage is 311V. From this calculation, we can obtain the instantaneous maximum power of each resistor is 228mw, which seriously exceeds the rated power of the resistor, so it is dangerous to use.
  2. The response speed of the zero-crossing point of the optocoupler is slow, and the rising edge time of TZA is long. The actual test found that the transition time of the rising edge and falling edge of the zero-crossing point of the optocoupler is about 120us (the voltage difference between the high and low levels is 3.3V). It is acceptable for general applications, but for synchronous applications in communication, the response time will seriously affect the communication quality. Because within 120us, it can be considered as a zero-crossing event, which means that my judgment of zero-crossing may have a deviation of up to 120us.
  3. According to the conduction characteristics of the optocoupler, the zero point of this circuit indicates the zero point that lags the actual alternating current occurrence. The lag time can be calculated according to the conduction current of the optocoupler. The typical value of NEC2501 is 10ma. In fact, the optocoupler is generally turned on when the forward current reaches 1ma. Now calculate with 1ma current, the resistance is 3×47k=141k, then the voltage is 141V, and the corresponding lag time to zero is about 1.5ms. Assuming that 0.5ma is turned on and the voltage is 70V, the lag time is 722us.
  4. The on-time of the optocoupler is long, that is, the gradual change of the optocoupler current from 0 to the on-current is long, resulting in obvious differences in the edge time of the optocoupler characteristics and poor product consistency. Assuming that 1ma is used as the on-current of the optocoupler, the process of changing from 0V to 141V in 220v alternating current takes 1.5ms. Due to the consistency of the period, some optocouplers may be turned on at 0.5ma, and some may be turned on at 0.7ma. Now assume that the minimum on-current brought by the consistency is 0.5ma, then the corresponding on-voltage is 71V, and the corresponding zero-time lag is 736us, which indicates that the zero-point difference between different optocouplers may reach 764us! (In the actual test, I tested 10 samples, and the time difference between the two optocouplers with the greatest difference in conduction performance reached 50us, and the others were generally around 10us). This creates a lot of trouble for different devices to use this circuit to synchronize.
  5. Limited by the on-current of the optocoupler, the amplitude range of the AC signal that this circuit can detect is narrow. Calculated at 1ma, this optocoupler can only detect signals with an AC signal amplitude greater than 141V. If this signal is used for synchronization, the synchronization signal will not be acquired when the device is under low voltage testing.
  6. The TZA output waveform is quite different from the standard square wave, and the duty cycle is higher than 50%. In the actual test, the time error of the duty cycle reaches 1.2ms, which cannot be ignored in the application.

基于以上列出的各个问题导致利用交流电过零点进行同步质量较差,需要改进。首先我想到的方案是利用比较器的比较功能来产生标准的方波。在交流电的正半周比较器输出高电平,在交流电的负半周比较器输出低电平。该方案的时间误差仅取决于比较器电平跳变的响应速度和比较器的差分电平分辨率。以lm319为例,偏置电压最大为10mv,比较灵敏度为5mv,5V输出电平跳变响应时间在300ns以内,加上asin(10e-3/311)/2//pi/50 = 100ns。二者总共相差约400ns,远低于图1所示的方案。在实际应用中我使用了LM358来代替比较器,其偏置电流为50na,串接1M的电阻,满足偏置电流的电压为50na×1M=50mv。按照st-lm358资料,其开环频率响应1k一下可以达到100db,因此理论上输入1mv的电平依然可以识别,和前边假设相比取50mv,asin(50mv/311)/2/pi/50 = 500ns,放大器的SR为0.6V/us,假设转换到4V,需要7us。因此使用LM358的绝对误差为7.5us,而实际上由于每个器件的共性,因此在同步上偏差应该小于1.5us。

 

方案定下来以后就应该进行电路设计了,在实际电路调试的时候遇到很多问题,现记录于此供以后参考。主要问题包括有:

  • 对于差分运放电路缺乏基本的认识,最初考虑用电阻分压电路,按照最大电压311V,电阻分压1:100,选用2M电阻串接一个20k,取20k两端的电压,理论最大差为3.11V的样子,电路如图2-1所示。该电路最终以失败告终。经过学习和查找原因,是因为没有可靠的工作点,或者说没有统一的参考地,浮地输入无法实现放大。同样因为这个原因,在网上寻找的如图2-2所示的电路也以失败告终。

     

  • 为了能够对差分放大电路提供统一的参考基准最终对图2-2进行修改,分别从差分输入的+端和-端引一个大电阻到测试系统的“地”,因为是单电源放大考虑到LM358的共模输入信号范围0-VCC-1.5V,由于二极管限幅,二极管两端电压最多0.7V,又因为对于去其中间电平连接到地,正负端对地输入的电压范围为-0.35到+0.35。最终电路如图3所示,该电路可以实现设计功能。

 

 

经验总结:

  1. 理解运算放大器的共模输入范围,这对运放电路设计很重要。如果输入信号超过共模电压范围,放大器将不能正常工作。
  2. 任何信号耦合都是需要电流驱动的,放大器限流以及不同设备间“地”的连接不是电阻越大越好。当初设计图3的电路,最初R2和R3取500K时,用示波器双通道同时测试测试地到R2,R3两端差分电压,显示其具有相同的波形,幅度8V左右。理论上其原R2,R3两端波形幅度应该为0.35V,相位相反。经过反复试验,发现其原因就在于经过R2,R3电流太小已经没有达到共“地”的效果了,降低R2,R3阻值测试波形和理论一致。
  3. 当初为了安全测试220V端电压波形,查阅了浮地测试技术的相关资料。同时经过实验验证,浮地测试必须要将示波器和被测试系统的公共地断开,具体来说就是让测试仪器和被测试平台不具备相同的参考地电位,这样短接示波器探头的地到被测试平台才不会发生事故。拿本实验举例,假设我们需要测量市电实时波形,怎么测量呢。我们可以这样测试,示波器供电时三芯插头只连接L和N端,接地不连接,这样就可以通过接地夹夹在市电的一端,用探头去测量另一端的波形了。当然最好还是在接地夹串接以大电阻去接市电一端,探头也串接一大电阻去接市电另一端。如果不这样测试会有什么后果???如果不这样测试,因为示波器探头的接地夹是和三芯插头地线导通的,在通过接地夹去夹火线或者零线是就相当于把火线或零线直接与大地相连,如果是零线还没事,如果是火线那必然短路!非常危险!!!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325732629&siteId=291194637