Skip to content

BUG: Internal limit states - #640

Merged
nkoukpaizan merged 6 commits into
developfrom
lukel/repca-bug-fix
Nov 3, 2026
Merged

nkoukpaizan merged 6 commits into
developfrom
lukel/repca-bug-fix

Conversation

@lukelowry

@lukelowry lukelowry commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fixes four limiter bugs. The REPCA PI integrators kept winding up while the output was saturated, which left an offset in the plant's reactive power after a fault. They now use PowerWorld's treatment of antiwindup PI, which feeds the limited output back to the integrator in edge cases. REECB skipped its Vmin/Vmax limit on the voltage reference when VFlag is off, the ESDC1A rate feedback ignored the lower limit on the field voltage, and REGCA did not hold its terminal voltage at Vhvmax.

Proposed changes

  • Replace the REPCA PI antiwindup with PowerWorld's feedback PI
  • Remove the REPCA PI rate checks from initialize(), which could never fail.
  • Limit the REECB voltage reference to Vmin/Vmax when VFlag is off.
  • Feed the ESDC1A rate feedback from the limited field-voltage rate.
  • Hold the REGCA terminal voltage at Vhvmax, as PowerWorld does; Khv is now accepted but unused.
  • Add the FourBusLimits validation case, where a fault followed by a line opening drives all four limits.
  • Let Validation/plot.py plot references that mix variables.
  • Update the READMEs and tests.

Checklist

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • The CHANGELOG.md has been updated to reflect the changes.

Further comments

Compared against PowerWorld on a Hawaii fault, the reactive power error at plant 23_9 drops from 1.4 Mvar to 0.03 Mvar. FourBusLimits matches PowerWorld within 2%; with the develop models it is off by 21%. All validation cases still pass.

Does not change convergence in any scenario I tested, this is purely a niche technical modeling concern

@lukelowry
lukelowry requested a review from nkoukpaizan November 3, 2026 10:24
@lukelowry lukelowry self-assigned this Nov 3, 2026
@lukelowry lukelowry added the bug Something isn't working label Nov 3, 2026
@read-the-docs-community

read-the-docs-community Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 GridKit | 🛠️ Build #35623398 | 📁 Comparing 3e2d82c against latest (9963c0d)

  🔍 Preview build  

61 files changed · + 20 added · ± 41 modified

+ Added

± Modified

@lukelowry lukelowry changed the title BUG: Internal state of REPCA was not correctly limited BUG: Internal limit states Nov 3, 2026
@Steven-Roberts

Copy link
Copy Markdown
Collaborator

Should I try these changes for fixed vs adaptive experiments? Limiting in REGCA is what causes fixed step Hawaii runs so much convergence trouble. In case there is a related bug, I noticed limiters in SEXS-PTI exciters for ACTIVSg200 are similarly problematic.

@lukelowry

Copy link
Copy Markdown
Collaborator Author

Should I try these changes for fixed vs adaptive experiments? Limiting in REGCA is what causes fixed step Hawaii runs so much convergence trouble. In case there is a related bug, I noticed limiters in SEXS-PTI exciters for ACTIVSg200 are similarly problematic.

@Steven-Roberts If anything, this makes the solver's job more difficult, since here I am sharpening/enabling limits that were not engaged before. I did not see any convergence changes in my testing. Would not hurt to try, tho

@lukelowry
lukelowry force-pushed the lukel/repca-bug-fix branch from 8cc43cf to 6a7b4ab Compare November 3, 2026 19:22
@lukelowry

Copy link
Copy Markdown
Collaborator Author

@nkoukpaizan rebased, all addressed. thank you!

@nkoukpaizan
nkoukpaizan merged commit 0ff72a1 into develop Nov 3, 2026
7 checks passed
@superwhiskers
superwhiskers deleted the lukel/repca-bug-fix branch November 3, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants