# Rapidly reverse polarity of electromagnet

Please forgive my zero knowledge of electronics.

I have asked my people what I thought was a simple question but I just get bogged down with endless questions which I can't answer.

Expressing the situation as simply as possible.

1. I wish to use a couple of electromagnets about 2 or 3 inches long.
2. I wish to change the polarity of both magnets simultaneously about 20 times a second.

Question: Can anyone advise what device I require?

• How much current and what coil inductance (hence what energy stored needs to be wasted as heat per cycle) are you using? – Andy aka Apr 2 '14 at 18:20
• A couple of H bridges should do the trick. You will need enough voltage on the H bridges to get the current where you want it at your frequency range and you'll probably need current control of some sort. Without more detail like inductance, resistance, etc. it's difficult to be specific. – John D Apr 2 '14 at 18:20

Use a reasonably powerful audio amplifier, feed it with 20 Hz from a signal generator or something, and connect the magnet where the speaker would go. If this blows the output fuse of the amplifier or it catches fire or something, try again with more turns of a thinner wire when making your electromagnet.

• @TheFa: What repost? I see JYelton made a few edits to your post that cleaned up formatting, but didn't change the content. What I said still applies. – Olin Lathrop Apr 3 '14 at 14:47

An electromagnet might have an inductance of 1 microhenry or it might have an inductance of 1 henry - we can't tell from your question. There is a formula that can tell you how rapidly the current rises when voltage is applied: -

$V = L\dfrac{di}{dt}$

So, if you apply 12 V and it is a 1 henry inductor the current will rise at 12 amps per second. If, you need a current of 5 A for your application, to reach that current from a 12 V supply takes five-twelfths of a second (417 ms).

Therefore switching / reversing at 20 Hz (charge-discharge time of 2 x 25ms) will only really give you a fraction of the current (about 0.3 A) of what you might really need.

It's a bit worse than that - the hysteresis curve of iron (if that's what you are using) means you need to drive it a bit harder to reverse the magnetism to the same negative value as when first polarized in the positive direction.

To achieve this sort of performance (5 A in say 10 ms) means more a complex solution than just a simple H bridge and you need to think about this. You have also got to consider the energy "thrown away" as heat when the magnetic field is reversed. The energy stored in a 1 henry coil operating at 5 A is: -

$E = \dfrac{L I^2}{2}$ = 12.5 joules and this is being turned into heat 20 times per second.

That's a power of 250 watts that needs to be got rid of.

OK I'm playing devil's advocate a bit and in all likelihood your electromagnet might only be 30 millihenry and use a current of 1 A. The point is, you haven't said and I can't guess but hopefully, if you read this you'll have some idea what problems you might face.

• Heat from where? – Spehro Pefhany Apr 2 '14 at 19:59
• @SpehroPefhany now if you've commented it's gotta be important. - energy stored in inductor in one half cycle needs to be got rid of when current reverses - if this can be done efficiently no problem. If it can't then there'll be heat. – Andy aka Apr 2 '14 at 20:52
• I can imagine a situation where the duty cycle isn't 50% and you pump energy into the rails that has to be dumped somewhere (or the rail voltage increases until something breaks) , but if the duty cycle is 50%, I don't think there's a problem. – Spehro Pefhany Apr 2 '14 at 21:02

Two good H bridges will work. http://en.wikipedia.org/wiki/H_bridge

You'll need some kind of H bridge driver circuit as well or a microcontroller to operate it at that speed. A 555 timer or related circuit could suffice as the driver as well.