DPsim
Loading...
Searching...
No Matches
Base_Ph1_SVC.h
1/* Copyright 2017-2021 Institute for Automation of Complex Power Systems,
2 * EONERC, RWTH Aachen University
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 *********************************************************************************/
8
9#pragma once
10
11#include <dpsim-models/AttributeList.h>
12#include <dpsim-models/Definitions.h>
13
14namespace CPS {
15namespace Base {
16namespace Ph1 {
18class SVC {
19protected:
23 Real mBMax;
25 Real mBMin;
27 Real mBN;
29 Real mQN;
31 Real mTr;
33 Real mKr;
38 // Time step values
39 Real mPrevTimeStep = 0;
40 Real mDeltaT;
41
42 // param for mechanical model
43 Bool mMechMode = false;
44 Real mDeadband;
45 Real mMechSwitchDelay;
46 Real mTapPos;
47 Real mMaxPos;
48 Real mMinPos;
49
50 // save for numerical integration
51 Real mPrevVoltage;
52
53public:
54 Attribute<Real>::Ptr mDeltaV;
55 Attribute<Real>::Ptr mBPrev;
56 Attribute<Real>::Ptr mViolationCounter;
57
59 void setParameters(Real Bmax, Real Bmin, Real QN, Real nomVolt,
60 Real RefVolt = 0) {
61 // initial inductance very high 10^6 [Ohm] @ 50 Hz
62 mInductance = 3183.1;
63 mBMax = Bmax;
64 mBMin = Bmin;
65 //mBMax = 1;
66 //mBMin = Bmin;
67 mQN = QN;
68 mBN = QN / (nomVolt * nomVolt);
69
70 mNomVolt = nomVolt;
71 mRefVolt = (RefVolt > 0) ? RefVolt : mNomVolt;
72 }
73
74 void setControllerParameters(Real T, Real K) {
75 // Pt1 controller
76 mTr = T;
77 mKr = K;
78 }
79
80 void setMechModelParameter(Real deadband, Real switchDelay, Real maxPos,
81 Real minPos, Real nomVolt, Real RefVolt, Real BN,
82 Real initPos = 0) {
83 mMechMode = true;
84 // initial inductance very high 10^6 [Ohm] @ 50 Hz
85 mInductance = 3183.1;
86
87 mDeadband = deadband;
88 mMechSwitchDelay = switchDelay;
89 mMaxPos = maxPos;
90 mMinPos = minPos;
91 mTapPos = initPos;
92
93 mNomVolt = nomVolt;
94 mRefVolt = (RefVolt > 0) ? RefVolt : mNomVolt;
95 mBN = BN;
96 mBMax = mBN;
97 mBMin = mMinPos * mBN;
98 mQN = mBN * nomVolt * nomVolt;
99 }
100};
101} // namespace Ph1
102} // namespace Base
103} // namespace CPS
Static VAR compensator (SVC)
Real mTr
Time Constant.
void setParameters(Real Bmax, Real Bmin, Real QN, Real nomVolt, Real RefVolt=0)
Sets model specific parameters.
Real mBMax
Maximium susceptance [p.u.].
Real mInductance
Inductance [H].
Real mBN
rated B [S]
Real mNomVolt
Nominal Voltage.
Real mBMin
Minimium susceptance [p.u.].
Real mRefVolt
Reference Voltage.
Real mQN
maximum Q