I have an electromagnet, which is connected to the motor output of a motor driver. The electromagnet switches direction 0.2 Hz - 100 Hz. I control the frequency with a potentiometer. With another potentiometer I control the duty cycle (0 % to 100 %). Everything works fine. The pots are connected to an Arduino. The Arduino is connected to an L298N board, which is connected to the electromagnet. The resistance of the electromagnet coil is 18 Ohm
My question is, is there something I should be concerned of. There are no additional components attached to the electromagnet coil, just the motor output of the motor driver. The driver has its flyback diodes. The purpose of the electromagnet is to create motion in a magnetized fidget spinner, but that's another story. As I said, everything is working, but does this thing need some extra components for say prevent damage or for increasing effect? A capacitor? An inductor? A resistor?