Zero crossing detection is implemented by feeding the mains into an AC optocoupler. [Mic] discovered that the optocoupler diodes are not identical, so he had to adjust his firmware to account for ...