I'm working on an small electromagnetic motor and made one of the coils for it to test. The black spool is 3D printed (so maybe my problem is that I don't have the coil wrapped around a ferromagnetic core, but still) and wound with 24 AWG insulated copper magnet wire. I stripped the wire ends and connected a 9V battery to it, and the coil DOES magnetize, but only in short spurts (less than a second at a time). I usually have to take the battery away from the coil for a second and then reconnect the terminals for the coil to magnetize again.
Any ideas as to why the coil only gets magnetized for a second, and how can I make it so that a consistent and sustained magnetic field is produced?