EV-20 C19: a held read does nothing to a phase change under way
The C17 branch (end a phase change at its 0 A and pause) ran on a held read too, so one failed read just after a select stopped the car for the 600 s phase gap. A held read now leaves the change alone; it goes on at the next real reading. The silent meter still ends it at its 0 A. Rows: test_ev20_rig section 9. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
This commit is contained in:
@@ -673,4 +673,44 @@ for gap_at in (629, 630):
|
||||
f"629 s: 0 A at {z[:1]} (629-630)",
|
||||
present(nth(z, 0)) and 629 <= nth(z, 0) <= 630)
|
||||
|
||||
# =========================================================================== #
|
||||
print("\n9. SPIKE-06 C19: A READ GAP DURING A PHASE CHANGE")
|
||||
# =========================================================================== #
|
||||
# The C17 (b) shape without the silent meter: a 1 -> 3 change, its 0 A at
|
||||
# 301 s, select 3, closing current at 313 s. One to six failed charger reads
|
||||
# right after the select change nothing: the closing current comes on time
|
||||
# and no pause follows (0ef8de2: paused, no current until about 914 s).
|
||||
def phase_run(events):
|
||||
return S.drive(const(500.0), const(7600.0), dur=700, first="car",
|
||||
socs={"a": 100.0, "b": 100.0}, car_phases=3,
|
||||
events=events)
|
||||
|
||||
|
||||
for n in (1, 2, 6):
|
||||
r = phase_run({305: lambda p, c: p.ch.go_unavailable(),
|
||||
305 + n: lambda p, c: p.ch.go_unavailable(False)})
|
||||
w = cur_writes(r)
|
||||
close = [(t, a) for t, a, _ in w if a > 0.0 and 301 < t < 700]
|
||||
check(f"C19: {n} failed read(s) at 305 s, just after the select: the "
|
||||
f"closing current on time ({close[:2]}), no pause ({w[:5]})",
|
||||
present(nth(close, 0)) and 312 <= nth(close, 0)[0] <= 313 + n
|
||||
and [a for t, a, _ in w if 301 < t < 700 and a == 0.0] == [])
|
||||
nevers(r, f"C19 gap {n}")
|
||||
# A gap of stale_input_s or more during the change: the safe path as before.
|
||||
# The charger is taken as gone: nothing while it is away and no closing
|
||||
# current; on its return the change is dropped and Solar starts over (0 A
|
||||
# first, already standing here, so nothing is written; then the start rule,
|
||||
# which on the 3 phases the select left waits for the phase gap).
|
||||
r = phase_run({305: lambda p, c: p.ch.go_unavailable(),
|
||||
322: lambda p, c: p.ch.go_unavailable(False)})
|
||||
w = cur_writes(r)
|
||||
during = [(t, a) for t, a, _ in w if 305 <= t < 322]
|
||||
after = [(t, a) for t, a, _ in w if t >= 322]
|
||||
check(f"C19: a 17 s gap during the change takes the safe path: nothing while "
|
||||
f"away ({during}), no closing current, nothing non-zero before the "
|
||||
f"start rule after the return ({after[:2]})",
|
||||
during == [] and not [1 for t, a in after if a > 0.0 and t < 322 + 115]
|
||||
and r["c"].car_solar.seq is None)
|
||||
nevers(r, "C19 long gap")
|
||||
|
||||
report()
|
||||
|
||||
Reference in New Issue
Block a user