One thing I've been working on recently is the current-limit-mode indicator LED's. It's a little but harder of a problem than I thought it would be. My current limit comes from Q1 in the schematic. As the current flowing through R1 rises, it causes the voltage on the "+" input of the U2 op-amp to eventually exceed the ISET voltage. This drives U2's output high which in effect ties U4's output close to ground. My idea was to connect the "+" side of U4 to a spare input on my IO expander, and sample it's value in code. My initial thoughts were that a low value indicates that the circuit is in "current limit" mode. It turns out there are numerous reasons that this wont work. The face palm moment was realizing a low VSET value will also trigger the current limit logic regardless of the actual current! The other major problem was that I was using a digital input to estimate what is really an analog voltage.
Anyways here's the video:
So in pure voltage mode, and at the middle to upper range of the volt settings, the supply works beautifully. The measured voltage is very close to the set voltage, and the measured voltage jives with my multimeter. When the voltage setting is high, but in pure current limit mode, things also work well. It's the edge cases, where the voltage settings are low (<1 V) or the current setting is very close to what it would be at a given voltage, that it acts a little weird. More testing.
--P
Wow the video quality is horrendous. It looks much better than that before I uploaded it. I need to look into how to make videos better looking in blogger.
ReplyDeleteI skimped a little on details on this post too. I connected the output of U2 to the IOExpander. That takes care of the VSET problem, but I found that since the amp activates before in full current limit mode, and that fact that I'm sampling a PWM signal via a slow I2C interface, means that it's still not a great indicator of begin in current limit mode. I think in the end I'll have to resort to software to determine if I'm in current limit mode. The current measuring part of the circuit seems to be suffering from the highest error, making simple "if (Imeasured = Iset) currentLimiting = true" type logic not very reliable.
ReplyDelete