Commit 4b6ecb1c authored by Jan Dinkelbach's avatar Jan Dinkelbach
Browse files

fix intialization of input to PLL and power controller

parent 8888d6f5
...@@ -226,11 +226,6 @@ void DP::Ph1::AvVoltageSourceInverterDQ::initializeFromPowerflow(Real frequency) ...@@ -226,11 +226,6 @@ void DP::Ph1::AvVoltageSourceInverterDQ::initializeFromPowerflow(Real frequency)
else else
mSubResistorC->connect({ mVirtualNodes[3], mTerminals[0]->node()}); mSubResistorC->connect({ mVirtualNodes[3], mTerminals[0]->node()});
// Initialize control subcomponents
Matrix matrixStateInit = Matrix::Zero(2,1);
matrixStateInit(0,0) = std::arg(mVirtualNodes[4]->initialSingleVoltage());
mPLL->setInitialValues(mVirtualNodes[4]->initialSingleVoltage().imag(), matrixStateInit, Matrix::Zero(2,1));
// Initialize electrical subcomponents // Initialize electrical subcomponents
mSubCtrledVoltageSource->initialize(mFrequencies); mSubCtrledVoltageSource->initialize(mFrequencies);
mSubResistorF->initialize(mFrequencies); mSubResistorF->initialize(mFrequencies);
...@@ -244,18 +239,19 @@ void DP::Ph1::AvVoltageSourceInverterDQ::initializeFromPowerflow(Real frequency) ...@@ -244,18 +239,19 @@ void DP::Ph1::AvVoltageSourceInverterDQ::initializeFromPowerflow(Real frequency)
mSubCapacitorF->initializeFromPowerflow(frequency); mSubCapacitorF->initializeFromPowerflow(frequency);
mSubResistorC->initializeFromPowerflow(frequency); mSubResistorC->initializeFromPowerflow(frequency);
// TODO: check whether interface should be applied here // Initialize control subcomponents
// get current and voltage inputs to state space model // current and voltage inputs to PLL and power controller
// done here to ensure quantites are already initialized by initializeFromPowerFlow Complex vcdq, ircdq;
mIrcdq(0, 0) = - mSubResistorC->attribute<MatrixComp>("i_intf")->get()(0,0).real(); vcdq = rotatingFrame2to1(mVirtualNodes[4]->initialSingleVoltage(), std::arg(mVirtualNodes[4]->initialSingleVoltage()), 0);
mIrcdq(1, 0) = - mSubResistorC->attribute<MatrixComp>("i_intf")->get()(0,0).imag(); ircdq = rotatingFrame2to1(-1. * mSubResistorC->attribute<MatrixComp>("i_intf")->get()(0, 0), std::arg(mVirtualNodes[4]->initialSingleVoltage()), 0);
if (mWithConnectionTransformer) { mVcdq(0, 0) = vcdq.real();
mVcdq(0, 0) = mVirtualNodes[4]->initialSingleVoltage().real(); mVcdq(1, 0) = vcdq.imag();
mVcdq(1, 0) = mVirtualNodes[4]->initialSingleVoltage().imag(); mIrcdq(0, 0) = ircdq.real();
} else { mIrcdq(1, 0) = ircdq.imag();
mVcdq(0, 0) = mVirtualNodes[3]->initialSingleVoltage().real(); // angle input
mVcdq(1, 0) = mVirtualNodes[3]->initialSingleVoltage().imag(); Matrix matrixStateInit = Matrix::Zero(2,1);
} matrixStateInit(0,0) = std::arg(mVirtualNodes[4]->initialSingleVoltage());
mPLL->setInitialValues(mVcdq(1, 0), matrixStateInit, Matrix::Zero(2,1));
mSLog->info( mSLog->info(
"\n--- Initialization from powerflow ---" "\n--- Initialization from powerflow ---"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment