Use of a proper reistor in series with flyback diode gives two useful benefits:
-
Reduce discharge time of electromagnet (i.e. inductor).
Fig.1 Discharge time when no resistor is used (nearly 15 ms)
Fig.2 Discharge time when a 330 ohm resistor is used (nearly 2.5 ms)
(time-response graphs are produced by fantastic Arduino Oscilloscope )
-
Reduce heat produced by electromagnet.
During discharge phase energy accumulated by inductor is dissipated mainly by the 330 ohm resistor. This results in a cooler electromagnet durign execution.