4 ms·
> i doubt that very much indeed. it isn't practical to run a switching power supply with feedback latencies of multiple milliseconds That's because the control
by burnerthrow008 3y ago
> i doubt that very much indeed. it isn't practical to run a switching power supply with feedback latencies of multiple milliseconds
That's because the control loop for a grid battery doesn't work the way you probably expect. The grid is effectively an infinite sink, so the voltage and frequency you observe "is what it is". You can't change it[^1], so you can't use voltage feedback from the output of your SMPS to drive the PWM. If you tried to do that with any kind of PID loop, you'd always be pinned at either maximum charge rate or maximum discharge rate[^2].
The correct way to do it is with an inner loop that will target a phase angle between grid voltage and your current. An outer loop (with a longer time constant) will set that target angle by comparing the measured grid frequency to a schedule.
> 100ms is 6 entire cycles of a 60-hertz sine wave
Yes, and?
You're measuring a sine wave, not a square with fast edges. Any voltage noise on the line is going to influence the zero-crossing and thus the measured frequency (which drives your battery controller). If you try have your controller do cycle-by-cycle corrections, you're again going to have your battery always at maximum charge or maximum discharge.
[^1] When Tesla's battery in Australia "saved the grid" when Loy Yang tripped offline, it dumped 150MW into the grid so that the rate of change of grid frequency was reduced. Even with the battery running balls to the wall, the grid was still slowing down.
[^2] Assuming that you haven't set your P and I terms to 0.
- kragen 3y agoi appreciate your comment! it's true, you can drive an h-bridge with a pre-canned pwm waveform whose phase you adjust with a latency measured not just in milliseconds but in seconds, though you'd better have safety mechanisms that respond to a fault on the line faster than that. you don't have to use feedback to generate the control signal! but at least in garden-variety class-d amplifiers reproducing arbitrary waveforms (rather than necessarily a fixed-frequency sine wave), you get better performance if you do use feedback, so it's common practice (disclaimer, i've never built power electronics, so i could totally be misunderstanding something) i think you're saying that any kind of a pid loop will alternate between being pinned at maximum or minimum when the plant isn't responding to the control output, unless p = i = 0. i don't think that's correct; i think it's sufficient to not make your p coefficient overwhelmingly large. a sufficiently large i coefficient will also make your control loop tend toward extremes in this situation, but not instantly, and a nonzero i will probably always win in the end when the plant is completely unresponsive. but a moderate p won't have that effect, and d can attenuate it. also, you can totally use current feedback from the output of your smps to drive the pwm, and that seems to me like it would be a very good idea
- burnerthrow008 3y ago> true, you can drive an h-bridge with a pre-canned pwm waveform whose phase you adjust with a latency measured not just in milliseconds but in seconds I’m not sure what you’re trying to say with this paragraph so I’m not going to respond to it. > think it's sufficient to not make your p coefficient overwhelmingly large. a sufficiently large i coefficient will also make What I’m saying is that making the P term small enough not to pin the PWM means that it won’t do anything useful, though I do see I wasn’t originally as clear as I could have been on that point. Either there won’t be enough gain or you will pin the output. There is no meaningful range of values in the middle, especially when the system needs to work outside the laboratory and you can’t tweak the parameters every other day. If you rely completely on the I term, you’ll have stability problems. So now it requires a lot of D term… and now you’ve gone full circle and we’re back to “the whole thing won’t work without a time constant which makes it totally useless to run a PWM and barely useful for the outer loop.” > you can totally use current feedback from the output of your smps to drive the pwm, and that seems to me like it would be a very good idea I did mention that already… along with the fact that you need to set some target for your current feedback using an outer control loop. You can set the target by measuring frequency error averaged across several cycles. Again, you need on the order of 100 ms to make that work. Whatever way you slice it, the grid backup battery is not going to start exporting power to the grid in less than a cycle, and certainly not in less than a millisecond.
- kragen 3y agothank you!