Mains Ground Safety for Power Supply?
The control electronics will be operated on power from a small transformer. This provides isolation from mains. I've done this a million times.
However, the mains power connects directly to the loop that produces the 24V signal. This is the loop after the FET, containing a diode, inductor, and capacitor. The wire coming from this loop and going to the comparator is where I'm having trouble. This is a voltage sensing wire and carries very little current, and is used by the comparator to produce negative feedback. This feedback loop is what allows me to get 24V from 120V. The comparator is powered by the 12V isolated supply. In order for it to sense the voltage properly, the comparator's ground must be at the same voltage as the power supply's ground. But the power supply's ground is tied directly to mains ground. Is that safe? Am I allowed to do that?
In mains wiring in the US, the left notch is neutral, the bottom hole is ground, and the right notch is hot. Neutral is basically ground, except ground is connected to the actual ground and neutral is this mysterious thing I probably don't completely understand. Is it safe to use it as ground?
What if the person using this circuit flips the plug over and suddenly the circuit's "ground" is fluctuating wildly between +/- 120V? The circuit may function just fine, but someone using a switch or knob connecting to ground could get a nasty shock. How do I make sure the ground of my circuit is always connected to actual ground? Do I need to preserve the isolation of the control circuitry? I know how to use Gate Drive Transformers for the FETs, but the sense wire for the comparator still needs to have both halves of the circuit with their grounds at the same voltage.
Any advice is greatly appreciated.