Skip to content

Commit

Permalink
(EMT model) improve comments
Browse files Browse the repository at this point in the history
Signed-off-by: Ghassen Nakti <ghassen.nakti@eonerc.rwth-aachen.de>
  • Loading branch information
gnakti committed Oct 16, 2024
1 parent 87fe3ea commit 1ee6bbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace Ph3 {
Real mVnom;
/// Simulation step
Real mTimeStep;
/// Active power reference

// ### Control Subcomponents ###
/// Droop
Expand Down Expand Up @@ -125,8 +124,8 @@ namespace Ph3 {
void initializeFromNodesAndTerminals(Real frequency);
/// Setter for general parameters of inverter
void setParameters(Real Omega, Real VdRef, Real VqRef, Real Pref);
/// Setter for parameters of VCO control loops
void setControllerParameters(Real Kp_voltageCtrl, Real Ki_voltageCtrl, Real Kp_currCtrl, Real Ki_currCtrl, Real Omega, Real taup, Real taui, Real mp );
/// Setter for parameters of VCO and Droop control blocks
void setControllerParameters(Real Kp_voltageCtrl, Real Ki_voltageCtrl, Real Kp_currCtrl, Real Ki_currCtrl, Real Omega, Real taup, Real taui, Real mp);
/// Setter for parameters of transformer
void setTransformerParameters(Real nomVoltageEnd1, Real nomVoltageEnd2, Real ratedPower,
Real ratioAbs, Real ratioPhase, Real resistance, Real inductance, Real omega);
Expand Down
11 changes: 5 additions & 6 deletions dpsim-models/src/EMT/EMT_Ph3_VSIVoltageControlDQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ EMT::Ph3::VSIVoltageControlDQ::VSIVoltageControlDQ(String uid, String name, Logg
// Sub voltage source
mVs->setReference(mSubCtrledVoltageSource->mIntfVoltage);

// Droop
// Droop block
mDroop->mInputRef->setReference(mElecActivePower); // maybe mPref ?
mDroopOutput->setReference(mDroop->mOutputRef);

// VCO
// VCO block
mVCO->mInputRef->setReference(mDroopOutput);
mVCOOutput->setReference(mVCO->mOutputRef);

Expand All @@ -97,7 +97,7 @@ EMT::Ph3::VSIVoltageControlDQ::VSIVoltageControlDQ(String uid, String name, Logg
mVoltagectrlOutputs->setReference(mVoltageControllerVSI->mOutputCurr);
}

//setter goal voltage and frequency
//setter target voltage and power
void EMT::Ph3::VSIVoltageControlDQ::setParameters(Real Omega, Real VdRef, Real VqRef, Real Pref) {
mParametersSet = true;

Expand All @@ -119,7 +119,6 @@ void EMT::Ph3::VSIVoltageControlDQ::setParameters(Real Omega, Real VdRef, Real V
//setter for transformer if used
void EMT::Ph3::VSIVoltageControlDQ::setTransformerParameters(Real nomVoltageEnd1, Real nomVoltageEnd2, Real ratedPower,
Real ratioAbs, Real ratioPhase, Real resistance, Real inductance, Real omega) {

Base::AvVoltageSourceInverterDQ::setTransformerParameters(nomVoltageEnd1, nomVoltageEnd2, ratedPower,
ratioAbs, ratioPhase, resistance, inductance);

Expand Down Expand Up @@ -271,7 +270,7 @@ void EMT::Ph3::VSIVoltageControlDQ::initializeFromNodesAndTerminals(Real frequen
mDroop->setInitialStateValues(matrixInputInit, matrixStateInit, matrixOutputInit);
// Input: [OmegaSet] //State: [theta] // Output: [theta]
mVCO->setInitialValues(**mDroopOutput, theta, theta);
}
}
else
{
// Initialize control subcomponents
Expand All @@ -286,7 +285,7 @@ void EMT::Ph3::VSIVoltageControlDQ::initializeFromNodesAndTerminals(Real frequen
**mIrcd = ircdq(0, 0);
**mIrcq = ircdq(1, 0);

// Droop and VCO initialisation
// Droop and VCO initialisation
**mElecActivePower= **mIrcd * **mVcd + **mIrcq * **mVcq;

Matrix matrixInputInit = Matrix::Zero(3,1);
Expand Down

0 comments on commit 1ee6bbd

Please sign in to comment.