Too much op-amp slew rate, or how do you sense the current properly? - Page 1
Forum section: electronics / projects

author: Artlav
author_rank: Frequent Contributor
timestamp: May 15, 2015, 11:45:58 pm
content: I want to regulate the current going into a big electromagnet.100-150A of it, to be precise.So i came up with a design for a switching regulator for that, and was testing it.EDIT: The idea is - first op-amp amplifies 0-75mV (RC filtered) from the shunt to 0-5V, second op-amp acts as a comparator with hysteresis, it's output drives an isolated gate driver (HCPL-3180).The frequency is determined by a combination of the load inductance and comparator hysteresis.In other words, the magnet is free-wheeling; once it's below threshold, some current is added until it's above threshold.Rough schematic, to show the power part:First, on a breadboard at 3A.It runs more or less fine, but the FET would occasionally switch back on after turning off, as if it picked up something that isn't a signal.Looking close at the output of the second op-amp (MCP602 dual one), the one working as a comparator, i saw that it took it's sweet time rising and falling.I assumed that the driver wasn't getting the signal fast enough and so it was triggering on and off at some intermediary value.So i went and got MAX4016, which got 600V/uS, instead of 2V/uS for MCP602.Thinking it was the only problem, i cleaned up the design, made a PCB for it, assembled the thing from proper-rated parts in a half-proper way, and tried to test at 30A.However, things went south from here.It was regulating, but instead of a PWM, it was a proper off period, and an "on" period made of the output oscillating high and low as fast as the gate driver could go!After trying to filter out noise, sticking capacitors here and there and so on without effect, i finally put MCP602 back in.And suddenly it was clear and quiet!No signs of added pulses either.So, the primary question is - just what went wrong with too much slew rate?How do you determine how much is too much?Secondary question - is there anything obviously wrong with the circuit?It appears to work fine, but i'm a bit reluctant to believe in success at the moment, and stepping up the power without being sure can very well result in some energetic magic smoke release.I mean, i am curious what a busted SOT-227 package looks like, but i don't want to get one in my face, no pun intended.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 16, 2015, 03:48:57 am
content: Surely you're trying to do this linear, but forgot to add compensation components and negative feedback??The voltages are undefined, but mind that the second op-amp has to be able to drive the gate extra high if you want low dropout, or total saturation.If you're actually looking for switching, the current amp needs to be fast enough to sense dI/dt without slew rate limiting or reduced bandwidth, and the second amp needs to be a comparator plus gate driver. The circuit should oscillate at a frequency defined by supply voltage, inductance and loop losses (predominantly diode drop and ESR, I think). The downside to this circuit is, it doesn't have a very well defined oscillation frequency, and parasitics can easily ruin your day.You need to make very sure you have no residual inductance in the sense resistor. This can be approximated by routing the sense wires flat over the shunt (so they share equal and opposite mutual inductance with the shunt itself), and compensated by adding a loop away from, then back towards, the shunt. The effect is easily visible on the scope against a square/triangle wave (voltage/current), but not easily calculated.The fundamental purpose of an op-amp is to be slow (a combination of their design requirements: unity-gain stability using a dominant-pole compensation method), so they generally make piss-poor comparators. I suppose throwing faster amps at it will solve that, but beware supply bypass, coupling and shielding. Stable operation on a single layer board may not even be possible.Tim

author: DanielS
author_rank: Frequent Contributor
timestamp: May 16, 2015, 04:05:01 am
content: Quote from: T3sl4co1l on May 16, 2015, 03:48:57 amI think OP has been pretty clear about wanting PWM-style regulation. The first amplifier acting as the error comparator and the second one as the MOSFET driver with some hysteresis.One thing missing from his circuit when using high-speed amplifiers like the MAX4016 is a nearby decoupling capacitor. I bet the supply gets quite noisy due to supply/ground inductance when the op-amp switches between sourcing and sinking 100mA within nanoseconds to drive its output and load(s) from rail to rail.

author: Artlav
author_rank: Frequent Contributor
timestamp: May 16, 2015, 08:09:01 am
content: Sorry for the confusion - the first schematic was only conceptual, not functional.The second one is the real one.The idea is - first op-amp amplifies 0-75mV (RC filtered) from the shunt to 0-5V, second op-amp acts as a comparator with hysteresis, it's output drives an isolated gate driver (HCPL-3180).The frequency is determined by a combination of the load inductance and comparator hysteresis.In other words, the magnet is free-wheeling; once it's below threshold, some current is added until it's above threshold.Quote from: T3sl4co1l on May 16, 2015, 03:48:57 amIs there a drawing for this somewhere?I have trouble visualising that.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 16, 2015, 10:32:15 am
content: I built this current pulse jig to test my electronic fuse project,note the wire coming from the capacitors, which enters behind the shunt resistor. That section of PCB is isolated as an SMT pad, so that's the "hot" end of the shunt. The other terminal is returned to ground . So when the pulse fires and pulls the "plus" end of the capacitors down, the "ground" end of the capacitors gets pushed negative, making a negative drop across the shunt. It's a supply-return side shunt. The blue wire is the sense (output) voltage.If you connected the blue wire straight in sideways, flat, along the board, you'd have minimum leakage around the wire. But the reading gets 100% of the EMF developed across the inductance of that damn loop, which is going to be a lot (~20nH).You can filter that inductance, because the ESL and ESR of the shunt has a characteristic time constant (high pass characteristic). Following it with an RC (lowpass) of the same time constant will restore the correct waveform. But now you have series resistance. This is okay for most ICs (the noninverting stage in your case, or the current sense input on a UC3842 for a typical SMPS example), but wasn't acceptable here, because I need to drive a terminated 50 ohm transmission line.To get an accurate signal into 50 ohms, I would have to use a very small series resistor, and overly large capacitor. But such a low impedance would bring into question the ESL of the resistor and capacitor, making the frequency response that much more complicated. That stinks. A larger resistance would be easier to deal with, but would reduce gain, and then I'd have to calibrate the scale even more.Instead, I have the blue wire looped up and over the shunt, following it as best it can. This gives something like 80-90% cancellation. It's not perfect, but it helps a lot. (Note that, because it's not 100% of the inductive EMF anymore, a single pole RC filter can't be used to "clean up the rest" -- that would filter both the intended signal AND the EMF.) To get >100% cancellation, it goes around a second turn, and that turn isn't quite as close in, since together they only need 50% each, after all.For the linear shunt case, just un-bend the shunt here. You still have turns alongside it, but they're making a loop alongside, then out and away and back, then alongside again. Effectively, the segments where the loop is close to the shunt, are the parts that generate the opposing EMF. The parts more distant pick up less EMF, and therefore serve to bring the wire back along the shunt, so it can have another go and pick up more opposing EMF.Guessing that still needs a drawing...Tim

author: Artlav
author_rank: Frequent Contributor
timestamp: May 17, 2015, 08:49:16 pm
content: While we are at it, what kind of snubbers should i put on this thing, and how to calculate how much input capacitance (and of what current rating) to use?Even with a bit better power bus there is still quite a bit of ringing on the FET and diode (testing at 15A).Adding a capacitor across the FET helps, but i have no idea if it's a good idea.Here is the power part cleaned up:Quote from: T3sl4co1l on May 16, 2015, 10:32:15 amGuess so...Just noticed that with the wires as they are in my last photo just touching them changes the frequency a bit, and moving them around - by a lot.The wires are perpendicular to the magnet and parallel to each other, so they shouldn't pick up too much noise.Yet, something is still wrong.Curiously, only the frequency change, not the current (assuming a clamp meter can be believed while sitting next to a magnet, even perpendicularly to it...).