Design and simulation for ov/uv/overcurrent/reverse polarity