I am trying to build a PV charger (PWM), which I guess is kind of a buck converter. Below is a first LTSpice simulation. V1 are the PV modules, V3 is the battery. V2 is the microcontroller's supply voltage. L1 is my estimate of the wire inductance. For D1 I chose whatever came to my mind first. M1 is about as close to my future buyer's choice as it can get.
The current is rather smooth, but the potential at the MOSFET drain jumps pretty high when the MOSFET turns off (and only then, turn-on is uncritical). The reverse current (discharge current) through the battery is only of the order 200 mA for the duration of that transient, so probably nothing much to worry about (battery capacity is 120 Ah). But who knows... batteries are said to have a human-like qualities.
Why does it happen and how can I stop the circuit from doing this?