??? 12/08/05 05:33 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#104862 - mains filtering Responding to: ???'s previous message |
The zero crossing input is used as a correction for the timer. Assuming we're using a capture input for the zero crossing, the software does a simple window comparison between captures to check to see if the value is within the expected range - if it's out of the expected range, the value is rejected, no correction takes place. A timer compare is used to generate the internal zero crossing. The period value gets adjusted by the period of the incoming zero cross captures - a simple low pass filter is used to limit the rate of correction, so the internal compares will be frequency locked to the zero cross captures. To phase lock the internal compares to the zero crossings, the difference between the internal and external zero crossings is calculated and based on the magnitude of the difference, a correction is added or subtracted from the next compare value. Eventually, the two will be phase locked. A fixed offset can be added in so that phase shifts due to external filtering can be cancelled out. Therefore the internal compares will be very close to the actual zero crossing of the mains. Something like X10 is synchronised to the mains, so that won't affect zero crossing detection, but zellweger is asynchronous - as it moves through zero crossing, it causes major errors in the zero crossing detection - if you're doing phase control it causes false firings. The above technique remove the effects of mains borne interference so that your phase control behaves as you would expect. |