: M7 k% F/ k% B5 [) x) sThe model of this example updates the present state of the % h, T; E! T5 W+ t, `3 t
circuit breaker by taking into account the conditions 7 A0 p1 M; A% Dcontrolling four represented state transitions: first opening, - N( _ f- u* k0 S. |
reigniting, reopening, and full opening.0 M9 M. ~4 A: k& b2 r& k
) \3 r/ b1 ~1 w6 ?7 a. ]. E
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ENDCOMMENT( x" ?' t; B# a! { `
/ N+ N& P' |) R7 xDATA* P6 D7 s+ L! @1 _3 @% ~: E" D
topen -- [s] earliest elec opening$ P- Y: X1 H% t) d& N9 L
ich1 -- [A] chopping level at power frequency# {7 T, I+ u- Q, E
slope -- [A/s] current slope; J6 j" H( }3 E# s
reopen_delay {dflt:2.5e-6} -- [s] reopening delay' {7 g1 X: O& S
reignit_w {dflt:1e-2} -- [s] reignition window: x- K1 O; L0 O2 {( i& e
, l Z. z2 @) ?2 D2 W: j4 }INPUT; u1 |4 y/ i* A( V: w3 N9 N( j
v1 -- voltage across breaker terminals0 v, |* [+ w; t. r0 d
v2* T9 a1 Q2 ]* Y& i
current -- current through breaker: v8 n2 K8 W) j: o
. n$ o! @/ `* k, M6 M. xVAR9 Q8 _( f7 D! F: ?" W9 Z- ?1 c/ Y* n
state -- 0= fully open 5 I* {0 I# f! _+ Z4 a -- 1= normal closed; X: n( K1 E$ d
-- 2= tentatively open2 @8 U& Q. [) T3 b$ c h% I
-- 3= reignited : U/ L4 w" ]5 V8 R first_opening -- transition from 1 to 2 P. u" C% q" W! P8 D
reigniting -- transition from 2 to 3 2 c8 H0 E8 r, O: }, M/ U% I- L reopening -- transition from 3 to 2# S' G V! L+ G+ e. G4 i0 N* N. J
fully_opening -- transition from 2 to 0, Z% @( X9 K, q# w) }
reopen_clock -- state variable of 3 . a: ~2 w; V" N elapsed -- time elapsed since tbeg 3 b$ G1 {8 V2 G1 k% S+ O7 A cbstatus -- open/close signal to switch + V4 I% j7 B# u q4 H6 u deltav % _+ E- M& o5 z x% K- q, ]. B ds+ a+ s0 }5 t9 f' m& x
nds0 [# T! j& h; L% r$ R* I# Y
tdelta - `/ U. M5 N5 {$ n/ D/ m itopen- I! J: _' s! _( x
ich2! f& T/ T7 P6 h4 `3 p
4 `3 N. z+ f0 B$ c0 d; g3 e
OUTPUT: d" x* l$ q3 x1 T
cbstatus ,ds,nds' [( O+ N( z$ X1 a" A8 i( m a" I$ y
9 O- J/ M( w r+ dHISTORY $ h K4 k# ~ B8 f/ B7 q5 ?5 U* w current {dflt: 0} . |3 }& s. K# R3 J, Z9 f& H: L " x5 }6 ^% r5 M: bINIT0 L1 v& }4 _, ~. y) I
state :=1 -- normal closed : I# J3 L6 r0 R* W# ? cbstatus :=closed " i# c p4 \. T% I( k- z3 i: U ds:=1- k" ^) _& J! b0 d. u$ `0 Q
nds:=-1 + N% Q" ^5 _) B1 Z: [9 M3 w: {7 W6 qENDINIT+ d2 p5 i7 w" J8 J/ W+ \& A
7 G2 G& j" ^# U$ A% L3 n0 w% `' e
EXEC# K7 ?" S- P' d' ~. k
deltav:=v1-v29 C! L6 G7 w) _3 i5 x2 w' A
IF t>=topen THEN -- otherwise do nothing % f6 x+ Y! _. h' E0 ?6 M) E tdelta:=(t-topen)*1000. C% R7 u! N& p* _' [$ o
IF tdelta<=0.44+ F3 l5 U! A( z, `2 |, j1 }0 b" d1 p
THEN ds:=(38.5*tdelta**1.5)*1000 $ |0 y6 ?2 d# y3 | ELSIF tdelta>0.44 AND tdelta<=5.000 w, f' d3 `- V7 K" w
THEN ds:=55.1*tdelta**0.55*1000' l$ N, R: l& m5 L. B |
ENDIF2 _/ W/ n7 b& n. O$ \! k
: m/ a- y H9 f2 e7 x) f+ I9 `
nds:=-ds & i! t- `2 n- S* k itopen:=abs(current) u$ a4 B- L2 ?; h" x9 _
ich2:=(2*pi*50*14.3*itopen*6.3*exp(-16))**((1-14.3)**(-1)) 3 J4 ]6 ?$ t8 V2 y7 z! z4 b) C9 Y( w
first_opening :=false; fully_opening :=false 1 P8 j3 o* R0 N' m reopening :=false; reigniting :=false1 J4 d6 S" B/ E. Q$ @+ O, y
/ m: F2 J! ~( t9 X# K ^/ ] IF state=1 -- was normal closed+ `6 H1 ]. g3 d& U6 f
AND (abs(current) <ich10 @1 W' `: J9 m* b
OR current*prevval(current)<0) ! L% k7 Y6 y* a6 h' \ THEN first_opening :=true& |( x6 e+ t& { W# P3 C
elapsed:=t-topen . D4 s" \3 A+ |5 p2 z& d , l% S: ~( x( U8 A ELSIF state=2 THEN -- was tentatively open ; `! D, @# ]$ ~* L! U - h' A/ J6 ^0 [ IF elapsed>reignit_w THEN 9 \2 ?' k# f" a# ~0 ]2 d' |1 F6 C/ c7 Q fully_opening :=true & ]5 \: [. ~2 L3 k t# x: B( _" n ELSIF abs(deltav) > ds 0 N8 ]- j" c6 k( F THEN reigniting:=true3 j0 }7 \# g" D* D
ENDIF 0 C) L" j& j! f! H; u( n# U; f% X: C8 e
ELSIF state=3 THEN -- was reignited+ M; [" X: S4 Q9 B% ?
8 t$ ^: L0 A3 c
reopen_clock :=reopen_clock +timestep 9 p) x5 J; A) Q' e' C* b0 |# ?. S1 ~
IF reopen_clock >=reopen_delay0 |) l; `- @" | J1 K) @
AND (abs(current) <ich10 E) U+ L/ L( y; m
OR current*prevval(current)<0) & P: y1 l& I5 W0 N0 k/ i. I AND abs(deriv(current))<slope8 U! g% a+ C0 P+ W' r) Z! M
THEN reopening:=true; F& }" D4 }9 M) u2 e5 T; w( ` T7 z
ENDIF' Y8 R d/ g5 Y- _3 r
1 k8 e. p0 ~/ Z# G9 ?8 R
ELSIF state=0 THEN -- was fully open W+ ]! C# t% Q4 E( y
ENDIF/ |5 b3 q( e' y# v6 S
; q2 y$ I1 p6 r! g1 } IF first_opening OR reopening THEN3 Y, N W3 u: l' K3 t7 D. N: X
state :=2 -- becomes tentatively open% G$ n- w) v/ R9 I
: W' Z2 W; C9 \; r) v. K5 v+ \
ELSIF reigniting THEN 5 P2 @8 l) N G* S( A+ j+ C& r reopen_clock :=0 , j6 ]3 h; y( d3 ]' a" Q( w state :=3 -- becomes reignited& @3 }$ Z& J# y/ l
ELSIF fully_opening THEN + A/ U& }3 D& X/ i8 A r state :=0 -- becomes fully open$ I8 \6 U/ a9 ?) E' x" L" m( y
ENDIF ( R4 d3 E, l7 m4 ^# {) X% n' [/ F9 _4 U0 A' O
IF state = 2 OR state = 0 -- is now open & z3 k) w) q7 b THEN cbstatus :=open & M6 A2 v6 e* N ELSE cbstatus :=closed0 y9 _9 {; Q& ]% t7 `
ENDIF * L; w6 p: k9 Z5 B' ^; w+ e ]' x' o! Z& B9 ]/ i) x- T6 G3 u% K; V
/ S9 v/ {9 P! V6 H
ENDIF ( n, l: Y6 Z4 P0 E1 b7 y: f4 |, s5 X
ENDEXEC 5 J6 ]# r" K# l, i) {ENDMODEL: l+ p$ L- W/ F. n# b& V
* M$ i, a: q9 Q9 `- E
# w& z+ h/ R8 @7 l9 p