Hyseretic Current Control around INA180 Queries - Page 1
Forum section: electronics / projects

author: snoop33
author_rank: Contributor
timestamp: December 26, 2021, 07:30:08 pm
content: I've built this little current controller and have it up and running.0-2A current controlled by a 0-3V (DAC) signal. The 75mOhm resistor goes into a INA180A1 with a x20 gain, and 2x0.075x20 = 3V.I assumed the hysteresis would centre around the comparator however running it in LTSpice I can see that R1/R8 make no difference. Instead it appears to be around the saturation of the inductor and the bandwidth of the INA180. The frequency at 0.4A output (2A is max) is 256KHz.Apart from that it always tracks lower, about 10% then it should do. I haven't managed to fix it other than compensating the sense resistor to calibrate.Anything look wrong?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 26, 2021, 08:13:49 pm
content: That's... negative feedback, not positive feedback.Just flip around which side it's on, or take feedback from after the inverter, it'll be doing alright then.Note that hysteretic control has the downside of no frequency control; if under some combination of conditions, the comparator simply decides to go flat out ~MHz blasting, well, there's nothing your gate driver or transistor can do about it (well, until they melt, that is). Conversely, frequency drops sharply at the extremes of operation (here, low current; for a voltage converter, at very low or very high duty, i.e., Vout near 0 or Vin), which increases output ripple; it's harder to design an output filter (or input, for that matter) to cover that. (And again, not that that's necessarily a problem for the LED; more generally, about the control method for various applications, I mean.)Indeed, frequency response is critical for the sensor; if you don't have enough, consider reducing loop bandwidth by using a PWM modulator and current error amp, instead of hysteresis. Such anaverage current modecontrol can get away with lower ripple fraction, as well as loop bandwidth (roughly speaking, the two go hand in hand). So, it's good for high power applications in CCM, but probably not so practical for a little 5V (input) LED like shown here.Tim

author: snoop33
author_rank: Contributor
timestamp: December 26, 2021, 08:30:49 pm
content: I've been playing after I wrote and came to the same conclusion, feedback was wrong. This is better (see attached).The 'inverter' is a COG inside a PIC16 so no access, easier to shift the resistors. The 'DAC' is actually a PWM to voltage.Thanks for the heads-up which clarifies it. What's the method for determining the feedback values for something like this? If I had to guess I'd be looking at ripple for current extremes (so 20mA to 2A in this application)?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 26, 2021, 11:03:08 pm
content: Ah. You might be better off with average current mode, anyway. You'll have to calibrate or sense for DCM, and can use open loop PWM below that point basically, and feedback to control current above there. Keeps the circuit simpler, fewer resistors (at some expense to software complexity, naturally). A relatively open-loop configuration isn't so bad, if the load is stable (just an LED -- mind the tempco, design around that basically?).Or use the comparator to sense LED current (ground return side), do something like peak current mode control, or if not per-cycle control (some PICs have hardware for this) then something kinda like anti-knock where you run open-loop for the most part but when you detect a few overcurrent pulses, pull back the duty until it's okay again.I mean it's not even a big deal to have low ripple or consistent behavior; if it cycles up and down at some ~kHz, that'd be dumb for a power supply, but for LEDs, I mean..? (And if it does cycle, it's probably something that just needs tuning to behave better.)The biggest trouble will be low current operation, where the only thing you can do is spread out the pulses further -- you can't get pulse width any lower than a few clock cycles (at whatever rate that is).Tim

author: snoop33
author_rank: Contributor
timestamp: December 28, 2021, 01:15:51 pm
content: I've managed 40mA as a minimum (30mV DAC) which is acceptable.

author: snoop33
author_rank: Contributor
timestamp: January 20, 2022, 07:43:15 pm
content: Hi Tim,The circuit is built but I have quirks to deal with. You can see that I have a RC coming off the INA180. LTSpice simulates this as a working means to detect average current flow through the LED. In reality I get a figure quite far off, like half in some cases.The PWM2DAC tends to overshoot, 0.3v turns into 0.36v due to the feedback and gives 0.28A instead of 0.2A of current. I found upping the feedback to 1.5Meg improves it a bit.My thoughts now are whether the inductor is too small for hysteretic and whether the INA180 is a poor choice due to the relatively low bandwidth.