I'm building a circuit to switch shunt resistors to keep the shunt voltage within 0~100mV. The idea is to measure current over a larger dynamic range while keeping the burden voltage low. It does this with two comparators which trigger the set/reset inputs of a latch. The latch outputs drive low-side FETs to add parallel resistance, and there are four stages of this beyond the initial shunt resistance - though I'm having trouble even when using only one.
The shunt voltage is amplified by 23 and compared against trim-pot-set voltages, 180mV and 2.3V for down-switching and up-switching respectively. The problem I'm running into is that with a rising current source from 0-115uA, after the first shunt switch, from 1kΩ to 100Ω, the voltage drops more than a factor of 10. It drops far enough to trigger the down-switching comparator, which switches the shunt from 100Ω to 1kΩ, which causes the voltage to rise, crosses the up-switch comparator, etc - and so we have oscillation
I've got an oscope capture at 115uA. I'd expect it to drop to 100uA x 100Ω x 23 = 265mV, but it drops lower than 180mV and causes oscillation.
- CH1 (yellow): comp_down
- CH2 (magenta): comp_up
- CH3 (cyan): Vdut+Amp
- CH4 (green): VSW0
Note that I've probed VSW1 and confirmed that it is NOT activating.
The microcontroller and FTDI chip are not populated, but the ENCAL signal is shorted to ground to work during these tests. I've also changed the capacitors on the low-pass filters to be 10nF instead of 1pF, as previously it was too fast and caused VSW1, VSW2, and VSW3 to basically mirror VSW0. The trim-pots are installed, not the fixed resistor divider. The LED and driver FETs are also not populated.
Some other miscellaneous info:
- Powering with 5V off a bench supply. Noise doesn't look too bad
- Current source is a 2n3906 with potentiometer to manually adjust, range is about 0 to 1.2mA
- Board is a 4-layer PCB, internal layers are ground/5V
I know there's a lot of variables here, but I'm hoping somebody sees something simple I'm just missing. If it's just noise driving the signal into oscillation (doesn't look like it, but...) then I guess that's something I can try to manage. Thanks in advance!
Edit:
- Fair point - I didn't consider how important it'd be to be close to 10x parallel per stage
- I think I do though, don't I? I tried to design it such that if V>2.3, it switches up and if V<180mV, it switches down. I'd be happy to be wrong though, that sounds like an easy fix!
- Not sure I understand this one. Looks like there's a good 10us between comp_up's pulse and comp_down's pulse.
- Good point. I'll remove them for now. In my mind I saw more capacitance as more stable, but you're right they'll definitely induce a hard current draw