Hello All - I am new to circuits and the community. I have a door project which requires an electromagnet. I am trying to accomplish the following:
Pwm vdc in:
1. Gain a bit of smoothing with a capacitor.
2. Protect the voltage source from spikes when the field collapses.
3. Near instant on while limiting inrush current, and create a "soft stop" leveraging the capacitor.
Am I on the right track with a circuit like this? Any guidance would be welcome.

Pwm vdc in:
1. Gain a bit of smoothing with a capacitor.
2. Protect the voltage source from spikes when the field collapses.
3. Near instant on while limiting inrush current, and create a "soft stop" leveraging the capacitor.
Am I on the right track with a circuit like this? Any guidance would be welcome.
