This is my paintbrush schematic for an isolated dc converter.
Transformer is a toroid with a turns ratio of 2:1 that will bring down the 165v to 82v.
The mosfet on the left does the PWM stuff through an opto and an isolated 12 to 24v power module (supposed to say isolated).
Theres diodes on both sides of the transformer to try to dampen spikes but I think im gonna have to put a cap on the high voltage side as well.
Arduino measures the voltage of the 12v battery through a voltage divider, then starts sending the power and adjusts the duty cycle to make sure its always on 13.8v.
The mosfet on the right is just for reverse polarity protection.
So hoping someone with more knowledge than me can give me feedback and suggest improvements or spot things Ive missed, thanks