PCB design with esp32

rmetzner49
Posts: 27
Joined: Mon Mar 27, 2017 1:09 am

Re: PCB design with esp32

Postby rmetzner49 » Wed Apr 11, 2018 12:42 pm

ESP_Sprite:

"I have never seen a circuit design that feeds the power back into the power supply." Do you know what the term "Regenerative Drive" means as it relates to Motor Control? That's exactly what a Four Quadrant Motor Drive does.

ESP_Sprite
Posts: 9708
Joined: Thu Nov 26, 2015 4:08 am

Re: PCB design with esp32

Postby ESP_Sprite » Thu Apr 12, 2018 2:13 am

That's nice and all, but a boost/buck topology and a relay switching circuits are entirely different. Also, unless you're switching some fancy-pants bistable relay which needs a H-bridge to drive or something, current in a relay coil doesn't reverse: it's either there, going from positive to ground, or absent. To be fair, a boost converter also doesn't reverse the current in its coil. However, the topology for a boost converter is entirely different, and specifically built to dump the current from the collapsing magnetic field that is generated when you cut the voltage into a capacitor, while a relay circuit like the one the topic starter has just dissipates that energy.

A flyback diode usually is placed in-circuit like this:
flyback.png
flyback.png (11.39 KiB) Viewed 3292 times
I'll risk pointing out the obvious, but for any onlookers: here's how it works: S1 in this case is a BJT or a mosfet, and usually is connected in the ground line for practical reasons. To turn the relay on, you close S1, and the current through S1 and the coil will more-or-less slowly increase up to the resistive value of the coil. When S1 opens again, the magnetic field in the relay collapses, forcing a current from the switch side to the ground side.

This effect would normally just drain the battery if S1 was still closed, but it isn't. Without the diode, the current that the collapsing magnetic field induces into the coil cannot form a circuit, the resistance it sees is infinite. According to Ohms law, this also means the voltage is infinite, and weird as that sounds, in practice this comes pretty close. What usually happens is that the voltage rises until either S1 (which is a mosfet or bjt, remember) breaks, or the air ionizes and you get a spark. Sometimes, you're lucky and any even remotely conductive schmoo on your PCB stops the voltage from getting that high, but you cannot count on that.

Because this effect can kill your mosfet, D1 is placed in circuit. With this, the current from the magnetic field can form a circuit, and the voltage stops rising at the 0.7V the diode conducts at. The current happily goes round and round, and the energy from the collapsing magnetic field dissipates in the resistance of the coil and the voltage drop of the diode. Again, because S1 is open, the current cannot even get to the battery, let alone charge or discharge it.

And yes, of course I have heard of regenerative braking and techniques like that. But have you ever heard of a situation like that for switching a relay?

Who is online

Users browsing this forum: No registered users and 83 guests