13 #include <dpsim-models/SimPowerComp.h>
14 #include <dpsim-models/SimSignalComp.h>
15 #include <dpsim-models/Task.h>
48 Real mGamma_dInit = 0;
49 Real mGamma_qInit = 0;
53 Matrix
mA = Matrix::Zero(6, 6);
55 Matrix
mB = Matrix::Zero(6, 6);
57 Matrix
mC = Matrix::Zero(2, 6);
59 Matrix
mD = Matrix::Zero(2, 6);
89 Real Kp_currCtrl, Real Ki_currCtrl,
93 Real phi_qInit, Real gamma_dInit,
106 AttributeBase::List &attributeDependencies,
107 AttributeBase::List &modifiedAttributes);
109 void signalStep(Real time, Int timeStepCount);
112 AttributeBase::List &attributeDependencies,
113 AttributeBase::List &modifiedAttributes);
115 Task::List getTasks();
120 :
Task(**powerControllerVSI.
mName +
".PreStep"),
121 mPowerControllerVSI(powerControllerVSI) {
123 mPrevStepDependencies, mAttributeDependencies, mModifiedAttributes);
125 void execute(Real time, Int timeStepCount) {
135 :
Task(**powerControllerVSI.
mName +
".Step"),
136 mPowerControllerVSI(powerControllerVSI) {
138 mPrevStepDependencies, mAttributeDependencies, mModifiedAttributes);
140 void execute(Real time, Int timeStepCount) {
141 mPowerControllerVSI.
signalStep(time, timeStepCount);
const Attribute< String >::Ptr mName
Human readable name.
Real mTimeStep
Simulation time step.
void setControllerParameters(Real Kp_powerCtrl, Real Ki_powerCtrl, Real Kp_currCtrl, Real Ki_currCtrl, Real Omega_cutoff)
Setter for parameters of control loops.
const Attribute< Matrix >::Ptr mInputPrev
Previous Input.
Matrix mD
matrix D of state space model
Matrix mC
matrix C of state space model
void setParameters(Real Pref, Real Qref)
Setter for general parameters.
void signalAddStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes)
add step dependencies
Real mPInit
initial values for states
void setInitialStateValues(Real pInit, Real qInit, Real phi_dInit, Real phi_qInit, Real gamma_dInit, Real gamma_qInit)
Setter for initial state values.
void updateBMatrixStateSpaceModel()
Update B matrix due to its dependence on the input.
const Attribute< Matrix >::Ptr mStateCurr
Current State.
void signalStep(Real time, Int timeStepCount)
step operations
void initializeStateSpaceModel(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftVector)
Initialize vectors of state space model.
const Attribute< Real >::Ptr mVc_d
These are never explicitely set to reference anything, so the outside code is responsible for setting...
void signalPreStep(Real time, Int timeStepCount)
pre step operations
const Attribute< Matrix >::Ptr mOutputCurr
Current Output.
void signalAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes)
pre step dependencies
const Attribute< Matrix >::Ptr mInputCurr
Current Input.
const Attribute< Matrix >::Ptr mStatePrev
Previous State.
Matrix mA
matrix A of state space model
const Attribute< Matrix >::Ptr mOutputPrev
Previous Output.
Matrix mB
matrix B of state space model
Tasks to be defined by every component.