Repository navigation
Voltage card: draw trip and cease points as timer bars (PERC2, PERC1 DLL, PERC2 DLL) - #11
Merged
Merged
Conversation
All 4 stages per direction (repeats merged), each as long as its delay plus CMTDELAY, and the PERC2 DLL's momentary-cessation levels when they are on. One voltage_cease_points() now serves PERC2 and both DLLs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
On the live preview's Voltage at the load bus card (Screening, Post-Commissioning and the saved HTML report, which share
src/preview/page.py), each voltage trip or cease point is now a short timer bar. Before, it was a dashed line across the whole plot. This applies to PERC2 Standard, the PERC1 DLL and the PERC2 DLL.How each point is drawn
TDUA1 = 0, or the PERC2 DLL's momentary-cessation levels.<CON><level>.VLreconfor PERC2,VRPAfor the DLLs).Per model
VLcease/VHcease(Tcease), plusVLC1-4/VHC1-4with theirTV{L,H}C*delays. A point 3 is timed by point 1, as PSS/E 36.7.1 does.VDPA,VDUA). Stages 2-4 were not shown.VDPA-VDPA3withDMA-DMA3,VDUA-VDUA3withTDUA-TDUA3), each as long as its delay plusCMTDELAY(when the simulator trips it)VLBLK/VUBLK(no delay) when momentary cessation is on (MCFLAG = 1,FCEASE > 0)VceaselinePresets pad unused stages by repeating a stage, for example ERCOT's
VDUA2/VDUA3=VDUA1. A repeated point is drawn once, under its first name. An undervoltage stage at or below 0 pu can never arm, so it is skipped.Matching the stage that fired
The point that tripped the load comes from the simulator's own
trip_events, so the solid bar is the one the simulation actually used:VLM,VHM,VLC2, …), which is mapped to its (voltage, delay) point.stageindex in the simulator's order: undervoltage stages 0-3, overvoltage stages 4-7, then the PERC2 DLL's momentary cessation (8 =VLBLK, 9 =VUBLK).When momentary cessation is later taken over by a stage trip, both are marked: the cessation as "Ceased the load at …" and the stage as "Tripped the load at …".
Code (
src/preview/page.py)voltage_cease_points(result) -> list[CeasePoint]: one list of the drawn points for PERC2 Standard and both DLLs. Each point holds its voltage, bar length, side, name, delay text, first fire time and verb. It replaces the PERC2-onlyperc2_fired_pointsthat was added earlier on this branch._timer_bars(fig, result): draws the bars. Each bar is sampled at 25 points so hovering anywhere along it works.voltage_thresholds: now built fromvoltage_cease_pointsfor these three models. It still sets the y-axis range, and the standard model's legend still uses it.disturbance_header: the bar legend for these three models._swatch(..., bar=True): a 4 px rounded legend swatch.Why?
With PERC2 Standard on a preset like ERCOT, the voltage card had six dashed red lines crossing the whole plot. That was hard to read, and the lines said nothing about delays. On the DLL models the opposite was true: only stage 1 of each direction was drawn, so stages 2-4, which often decide the trip (for example
VDPA10.80 pu / 0.5 s with ERCOT), were not shown at all. A timer bar shows a point's level and its delay together, and the hover keeps the full detail off the plot.How was it tested?
Test counts (
uv run pytest -q): 879 passed, 1 skipped (the skip needs a real PSS/E install). The suite ran headless (QT_QPA_PLATFORM=offscreen).uv run ruff check src testsis clean.New and updated tests:
tests/test_perc2_preview.py::test_the_voltage_card_draws_each_cease_point_as_a_timer_bar, PERC2 Standard, ERCOT, 0.50 pu for 200 cycles:VLC2(0.80 pu / 0.5 s) fires, at about 1.01 s (0.50 pu is not strictly belowVLC4's 0.50);fault_starttofault_start + delay;tests/test_perc2_preview.py::test_a_ride_through_names_no_cease: a 5-cycle sag to 0.30 pu marks no point as fired.tests/test_preview_page.py::test_the_dll_voltage_card_draws_every_stage_as_a_timer_bar, run for both the PERC1 DLL and the PERC2 DLL, ERCOT withCMTDELAY = 0.05:VDPA,VDPA1,VDPA2,VDPA3,VDUAandVDUA1, with the repeats merged;VDPA1fires;fault_start + delay + CMTDELAY;VRPAline is full width;tests/test_preview_page.py::test_perc2_dll_momentary_cessation_has_its_own_marks:MCFLAG = 1,VLBLKis a zero-length mark credited with the first cessation, and its hover says "Ceased the load at";MCFLAG = 0it is not drawn.tests/test_preview_page.py::test_the_voltage_card_names_its_thresholds: the DLL legend is now "Trip thresholds" plus "Reconnect VRPA 0.90".I also printed the drawn points for the PERC1 and PERC2 DLLs with the ITIC, ERCOT and PJM presets on a trip and a ride-through. With ERCOT the fired stage is the same as PERC2 Standard's (0.80 pu / 0.5 s at 1.01 s). The PERC2 Standard card was also checked by hand in the app on this branch (
uv run perc-studio).What was not done?
Vcease) model: its single trip line is unchanged.preview/perc1_dll.py,preview/perc2.py) and the Voltage vs. standard card are unchanged. That card already plots every stage as a point against the envelope.TVM): the bars start at the event, not at the moment the filtered voltage crosses the level. With a non-zeroTVM, the fired time in the hover is slightly later than the bar's end.Checklist