Go Down

Topic: Using diodes to protect from reverse polarity (Read 2414 times) previous topic - next topic

Gary_Arduino

I have an electromagnet that is powered externally of my Arduino but that power is controlled by the Arduino through a relay.

Problem - the electromagnet will continue hold a strong residual magnetism after the power has been removed from it. This prevents the magnet from dropping it's load when the Arduino switches the power off.

Solution - turns out that a very SMALL amount of voltage applied in reverse polarity will instantaneously clear the magnetism. So, a quick pulse of low voltage from my Arduino would do the job!

Implementation Question
- Can I safely wire an additional Arduino circuit to the magnet, in reverse polarity, by using diodes to prevent the magnet's external power supply from traveling up that "reverse circuit" and shorting out my Arduino when the magnet is turned "on" ?


Things I have read about reversing polarity -
I understand that there is something called an "H Bridge" that allows you to reverse polarity on a motor, to run it in reverse. However, I don't need to "run" anything for any length of time. I just need a single, split second of power and a very small voltage at that. In a test (isolated from the Arduino) I have made the magnet release with a 3 volt spike but I suspect I can use even less than that. Also - the H Bridge seems complicated and perhaps expensive. 

I have also seen people mention they have used two relays to reverse polarity but I'd like to avoid that because that increase my project size and it will no longer fit into my project box. :(
Software - Arduino 1.8.5 on a Mac 10.7.5
Hardware - Arduino Uno (ATMEGA328P processor)

"Have patience. Sometimes it's hard to believe someone could know less than you do ... but those that know more than you, are struggling with the same thought."

bos1714

Hello there!

During the operation of the electromagnet there is current going through the coil. When the power is removed via the relay, is there a path for the leftover current to go through or will it just stay in the coil?
Time line? Time isn't made out of lines. It is made out of circles. That is why clocks are round.

Gary_Arduino

#2
Jul 20, 2018, 10:27 pm Last Edit: Jul 20, 2018, 10:30 pm by Gary_Arduino
Hi.
The magnetism can't actually be "drained off" and in fact can remain almost permanently ... until a current is allowed to pass through the magnet in the opposite direction.
It is apparently a physics phenomenon that I think I have seen called "Remanence".

To directly answer your question though, the circuit does not have such a "path". However in my initial attempts to deal with this residual magnetism (before I researched the problem) I did try connecting such a "path" but it had no effect.
Software - Arduino 1.8.5 on a Mac 10.7.5
Hardware - Arduino Uno (ATMEGA328P processor)

"Have patience. Sometimes it's hard to believe someone could know less than you do ... but those that know more than you, are struggling with the same thought."

bos1714

#3
Jul 20, 2018, 10:49 pm Last Edit: Jul 20, 2018, 10:49 pm by bos1714
I drew up a picture in microsoft paint of what I think your circuit looks like (I'm not sure if it's right or not). Is the black stuff correct for the most part?

If you put a diode in the configuration shown by the red symbol, that would allow current to flow through the magnet after the relay is turned off. After some time, the current should be dissipated by the magnet over time and should reduce the magnetic force.

Time line? Time isn't made out of lines. It is made out of circles. That is why clocks are round.

DVDdoug

#4
Jul 20, 2018, 11:36 pm Last Edit: Jul 20, 2018, 11:38 pm by DVDdoug
Quote
Implementation Question - Can I safely wire an additional Arduino circuit to the magnet, in reverse polarity, by using diodes to prevent the magnet's external power supply from traveling up that "reverse circuit" and shorting out my Arduino when the magnet is turned "on" ?
Through another relay, yes.   The Arduino can't directly-power anything other than an LED.

An H-bridge will work but it has to be able to handle the current.

Diodes will NOT work.   The back-EMF from an inductor can be thousands of volts and it can fry the diode if you put the diode in series.      It is standard practice to add a reversed diode in parallel with the driver (or across the relay contacts).    The kick-back voltage from the inductor is reversed, so the diode conducts and the voltage is knocked-down to the diode's forward voltage (~0.7V).  The current through the coil remains the same for an instant after power is removed and that current flows-trough the diode and it decays as the magnetic field decays.  That's why you get a high-voltage spark when you disconnect a coil...  It's trying to push current through an infinite resistance.

Here is a motor driver with a protection diode.   


But, with the parallel diode you can't reverse the voltage because the reverse voltage will be "shorted out" the same way the back-EMF was shorted-out.

Quote
During the operation of the electromagnet there is current going through the coil. When the power is removed via the relay, is there a path for the leftover current to go through or will it just stay in the coil?
No, the current flow stops but the iron becomes permanently magnetized (to some extent).    A coil does "try" to keep current flowing as the magnetic field collapses.   

"Capacitors resist changes in voltage."
"Diodes resist changes in current."


That's an over-simplification and a series  capacitor passes  AC (changing voltage) and it blocks DC (constant voltage) as it "tries" to keep constant voltage across the capacitor.

ReverseEMF

#5
Jul 21, 2018, 12:19 am Last Edit: Jul 21, 2018, 12:46 am by ReverseEMF
OK, since nobody (so far) has actually addressed the OP's actual question, how about this StrawMan:


Caveats:

  • VMag is the Voltage Source for driving the ElectroMagnet
  • VRelease is the Voltage Source for getting the ElectroMagnet to release.
  • The VMag supply, and the VRelease supply must be isolated!
  • I'm assuming the OP knows how to drive a Relay from an Arduino, since that seems to already be happening.
  • I'm pretty sure there is some sort of protection circuitry that needs inclusion [like to protect those relay contacts from arching, and such], but I'm not "up" on that, so hopefully one of my more informed colleges will chime in ;)
  • Also, since the OP supplied no details regarding the current/voltage requirements on that ElectroMagnet, other than what pertains to overcoming the residual magnetism, I gave no component details.  So, that will need to be ironed out.
  • DO NOT connect anything on the non-Arduino side of those relays, to ANYTHING on the Arduino side.  These two sections need to be isolated.
  • Make sure to NEVER energize both relays at once!!  In fact, probably a good idea to put some delay between switching -- for instance.  Open the Mag relay, delay a few hundred milliseconds, then energize the Release relay.


Also, "Dn" & "Dm" stand for the "Digital Outputs" on the Arduino.   For instance "D3" or" D12", etc.
"It's a big galaxy, Mr. Scott"

Please DON'T Private Message to me, what should be part of the Public Conversation -- especially if it's to correct a mistake, or contradict a statement!  Let it ALL hang out!!

Gary_Arduino

#6
Jul 21, 2018, 03:18 am Last Edit: Jul 21, 2018, 03:23 am by Gary_Arduino Reason: trying to add diagrams
Yes Thanks !
DVDdoug seems to have grasp my project exactly. Sorry for the initial, poor description.

While my Graphics Foo is not very good, I have drawn a VERY simplified version of the existing circuit and have attempted to attach it to this post.
I will also attach a simple diagram of what I had hoped to do ... but you have advised against.


 

Before I read your reply, I did did a breadboard version of my idea (completely separate from the Arduino) using two diodes as shown and a 3volt power supply (two 1.5 volt batteries) for the V release. I did notice that only .7v came through the diodes but that was enough to instantly release the magnetized plate. BTW - I am powering the magnet with 5volts stepped up to 12v through a small (ebay special) amplification circuit.

Still ... better safe than sorry I suppose. Your suggestion would seem to provide that.
I may be able to squeeze another relay into my project box but I will have to "unmount" my existing componants :( and move things around a bit.

Thanks everyone. :)

Software - Arduino 1.8.5 on a Mac 10.7.5
Hardware - Arduino Uno (ATMEGA328P processor)

"Have patience. Sometimes it's hard to believe someone could know less than you do ... but those that know more than you, are struggling with the same thought."

MorganS

How many amps and volts is this electro magnet? If it is under 30 then it is very easy to get an H-bridge motor driver to do that.

I do like Doug's schematic but if condition 3 (isolated supplies) is met then NONE of the diodes are required. You are losing up to 2.4V which is a significant fraction of a 12V supply. And the diodes get hot.

With dual-pole relays you don't need isolated supplies or diodes. With DPDT relays you can protect yourself from software errors switching both relays on at the same time. You could even make it work with a single supply, like an H-bridge.
"The problem is in the code you didn't post."

MarkT

#8
Jul 21, 2018, 12:31 pm Last Edit: Jul 21, 2018, 12:34 pm by MarkT
Yes Thanks !
DVDdoug seems to have grasp my project exactly. Sorry for the initial, poor description.

While my Graphics Foo is not very good, I have drawn a VERY simplified version of the existing circuit and have attempted to attach it to this post.

The second circuit seems to make no sense.  If the supplies are isolated the diodes can do nothing,
if the supplies are not isolated then one of the diodes is a direct power supply short to ground.

Isn't this a case of overthinking a simple problem?

You can use two current-limiting resistors to set a small reverse current through the electromagnet,
and a double-pole relay to switch the forward current.  In forward mode the relay also carries
current through both resistors, but this is a small fraction of the forward current so no problem.

On switch off the small reverse current is re-established by the resistors, cancelling the remanent field.

The resistors are cross-connected w.r.t. relay contacts of course so to reverse the current.  Two are needed
to prevent the relay from shorting the power supply.

Saves needing a whole H-bridge, and if the values turn out suitably the resistors would also act as
snubbers and speed-up the magnet switch off compared to a diode.

[ Its best to choose a thread title reflecting the nature of the problem, not of a proposed solution. ]
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Paul__B

Diodes will NOT work.   The back-EMF from an inductor can be thousands of volts and it can fry the diode if you put the diode in series.
Well, actually, a series diode will neither have an effect, nor be "fried" since it will only ever be passing current in the forward direction whether that is while the electromagnet is powered or when it is turned off.

I understand that there is something called an "H Bridge" that allows you to reverse polarity on a motor, to run it in reverse. However, I don't need to "run" anything for any length of time. I just need a single, split second of power and a very small voltage at that. In a test (isolated from the Arduino) I have made the magnet release with a 3 volt spike but I suspect I can use even less than that. Also - the H Bridge seems complicated and perhaps expensive.
The H-bridge is the way - essentially the only way - to reverse the current in the electromagnet (using a single power supply).  A resistor or an alternate voltage source can be used to provide a lesser voltage/ current in the "reversed" direction.

MarkT

To clarify my circuit:

The diode might be optional if the resistor values needed for the reverse current happen to be
good enough to snub arcing in the relay contacts.

And of course the relay drive circuit needs a snubber diode, goes without saying...
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Paul__B

So you are proposing using the forward voltage drop of the diode as a regulator to deliver about 1 V to the electromagnet in reverse?

Use two diodes in series if a higher voltage is required.

MorganS

It seems like a good scheme for heating up the diode. I doubt that it will do much for killing the electromagnet quickly.
"The problem is in the code you didn't post."

Paul__B

No, he actually did say:
I did notice that only .7v came through the diodes but that was enough to instantly release the magnetised plate.

FredScuttle

#14
Jul 22, 2018, 01:28 am Last Edit: Jul 22, 2018, 02:41 am by FredScuttle
How 'bout this?

The small reverse current does not demagnetize the plate, but repels it (same polarity magnetic fields), wonder if a charged up cap would be enough instead of opposite current?
Awww! Who needs an instruction manual to use a simple chain sa......

Go Up