Go Down

Topic: Diodo flyback in car (Read 433 times) previous topic - next topic

RcP

Oct 24, 2019, 09:29 pm Last Edit: Oct 24, 2019, 10:56 pm by RcP
Hello everyone, I am in a project for which with an Arduino Uno I command an opto-coupler and this in turn a mosfet-P transistor (IRF9Z34NPBF), all this will go in an installed vehicle.
Said mosfet gives a positive current to an electroiman 12v 5A, the negative part of the magnet connected it to the chassis of the vehicle.
As I have read here it is necessary to place a flyback diode to avoid inductive problems, but I have doubts for that diode to perform its function well, I doubt whether putting the cathode to the drain pin and anode to the chassis would be good or necessarily has to be directly in The pins of the electroiman itself? Or with the diode that carries the integrated mosfet is not necessary the flyback diode? Thanks for everything in advance

Paul__B

There is a common misunderstanding that the inductive "kickback" is generated by the inductor itself and therefore the diode must be connected directly across the inductor.

This is incorrect.  The impulse itself is generated by the component that switches off the current, so the diode should connect at that device.  It will probably make little difference where you physically connect it, as long as it is reliably connected to the correct part of the circuit.

The internal diode of the MOSFET is - necessarily - connected across the MOSFET so this is obviously irrelevant to the need to have a diode across the inductor.


MarkT

Kickback voltage is definitely generated by the inductor, there's no misunderstanding about that, but its due to rapid changes in current.  The diode across the inductor allows a path for current to continue flowing rather than reduce suddenly.

If the inductor carries a large current placing a diode at the switch and at the inductor is a wise precaution, as the stray inductance / characteristic impedance of the cable may generate large voltages anyway.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Wawa

There is a common misunderstanding that the inductive "kickback" is generated by the inductor itself...
I also have that misunderstanding, so please explain.
What else could generate that high voltage.

The impulse is ofcourse generated after the transistor switch turns off, but kickback current flows through the inductor. The shortest current path is when the diode is connected directly to the inductor. Any wire in between will act as an aerial and could transmit the spike to other circuits.
Leo..

JohnRob

A semi-related factoid.

Adding a "normal" diode across a relay coil can actually reduce life of the contacts by slowing down the collapse of the coil current therefore slowing down the mechanical opening time.   Best way would be a diode and an zener.


I don't have any numbers but I suspect for hobby purposes the effect is negligible.  Just though I would post it for others to obtain more probably useless info.
Please do not PM me with thread based messages.  If your thoughts are worth responding,  the group should benefit from your insight.

TomGeorge

#5
Oct 25, 2019, 11:56 am Last Edit: Oct 25, 2019, 11:56 am by TomGeorge
Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.... Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

RcP

Attached image with the connection, with this way to connect the diode would its correct flyback function? Or does it have to be directly connected to the electroiman pins?

Wawa

The diode there is fine. It's primary job is to protect the transistor.

That diagram won't work though. The opto can only turn the transistor 'on', not 'off'.
And the opto LED and/or the Arduino pin will burn out if you don't use a current limiting resistor.
Leo..

RcP

If I made a quick assembly, the resistors in the optocoupler and in the mosfet are missing so that it can be turned off.Otherwise as indicated in the image the connection would be good?  to the diode? thanks !!

Paul__B

#9
Oct 26, 2019, 04:50 am Last Edit: Oct 26, 2019, 04:54 am by Paul__B


OK, so that diagram is not drawn too well and has a number of issues.

As mentioned, it needs a pull-up resistor to pull the gate of the FET up to the battery supply to turn it OFF.  About 4k7 should be fine - drawing 2.5 mA and dissipating only 36 mW.  Using a 470 Ohm resistor in series with the optocoupler LED will drive it with about 7.5 mA which should ensure reliable switching.

The diode shown has an illegible marking but the symbol is a Schottky.  This is quite unnecessary unless you propose to use PWM, but using PWM would not work too well with the optocoupler for a couple of reasons.

I also have that misunderstanding, so please explain.
So it seems, and of course I will.  :smiley-lol:

What else could generate that high voltage.
It sounds simple to say the inductor "generates" the voltage and of course it does, but I deliberately referred to an "impulse".

The impulse is of course generated after the transistor switch turns off,
No, it is not generated after the transistor switch turns off, it is generated as the switch turns off.  The inductor is in the short term, a constant-current source.  Unless otherwise constrained, it will produce whatever voltage is required to keep that current flowing.  So you have a circuit consisting of a switch and a constant current source in an "open-collector" arrangement.  As the switch opens, the voltage rises.  It makes no difference whether it is "open-collector" or "totem pole" driving, the switch is the source of the impulse and the critical concept is that - it radiates from there.

but kickback current flows through the inductor.
Here is the point of the common confused thinking.  There is no such thing as "kickback current"!  :smiley-roll-sweat:

The inductor has a current flowing through it. When the switch opens, the current in the inductor and the wires that connect the inductor to the rest of the circuit instantaneously stays the same.  That is the whole point of an inductor - to resist any change in current.

OK, so what does change?  Where is there a current impulse?

Well, the diode of course!  Before the switch off, a current was flowing through the (power supply and) the switch (transistor).  After the switch off, the same current is now flowing through the diode.

So what current has changed?  Where is there a current impulse?

It is in the switch circuit, including the power supply itself, and the diode.  Current in the switch goes (suddenly) down, current in the diode goes (suddenly) up by the exact same amount.  Current in the inductor and the wires that connect the inductor to the rest of the circuit instantaneously stays exactly the same.  Then of course, the current in the inductor (and diode) smoothly decays - not as much of an impulse by any means.  So the wiring to the inductor does not generate an impulse (or a sudden change in magnetic field) between the inductor and the diode.

The shortest current path is when the diode is connected directly to the inductor.
Following from the above, if however you connect the diode directly across the inductor, the actual current impulse occurs in the wires that run beteen this and the switch, and it is this part therefore that radiates interference.  Not only that, but this also involves the wiring to the power supply itself, so any other devices that connect along this path will also be subject to the impulse.

Any wire in between will act as an aerial and could transmit the spike to other circuits.
Yes, the wires between the diode and the switch, not the wires between the diode and the inductor!  :smiley-cool:

What about the voltage "spike"?  Well, that appears on the switched line all the way between the switch and the inductor, including the diode terminal irrespective of where the diode is located.  It clearly is important that the two wires to any part of the circuit be bundled together as a pair, to minimise capacitive (electrostatic) radiation but much more importantly, to avoid electromagnetic radiation from "loops" in the wiring.

If the inductor carries a large current
Not strictly a factor
placing a diode at the switch and at the inductor is a wise precaution, as the stray inductance / characteristic impedance of the cable may generate large voltages anyway.
No, putting a second diode at the inductor is again, irrelevant!  :smiley-eek:

In fact, inductance in the cable will add to the voltage at the switch, as the switching impulse travels from the switch to the inductor, so the diode placed there will be first to conduct, and the diode at the inductor will not be needed as it is simply ineffectual!

In summary, note that the transfer of current is from the power supply and switch, to the diode.  To properly suppress the impulse, the triangle of three components which are involved must be located as closely as possible with short wires between: the switching device itself, the diode and the local bypass capacitor across the power supply.  The latter is needed to prevent the current impulse travelling back along the wires to the power supply itself

TomGeorge

#10
Oct 26, 2019, 10:07 am Last Edit: Oct 26, 2019, 10:12 am by TomGeorge
Hi,
This is something like you need;

Feel free , open to discussion.

Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

RcP

Thanks for your help, the diode I was planning to put is V4PAN50-M3 / I. If I forgot to draw the 330 ohm resistor between the arduino pin and the optocoupler and the 10k resistor between gate and source.  R2) 470R What is the function between the gate and the optocoupler?

Wawa

#12
Oct 26, 2019, 11:36 am Last Edit: Oct 26, 2019, 11:38 am by Wawa
R2) 470R What is the function between the gate and the optocoupler?
No function.

Bad circuit to use in a car though.
A 12volt car supply can be 'dirty', and a >20volt spike could kill the mosfet when 'on'.

Could leave the 470ohm resistor on the gate, and use a 12-15volt zener across the 10k resistor.
Leo..

Paul__B

No function.
Want to hear Tom's explanation of that!

RcP

I understand in case of a voltage peak greater than 20v the mosfet would damage, in this way with the resistance even if there is a voltage peak it would be protected right? Thanks!

Go Up