From c6c3ff70bfceac839af471c11fc8aa04060517b0 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Mon, 15 May 2017 21:50:48 -0300 Subject: Control test and sync generator control implemented Text buggy when opens --- Project/SyncGenerator.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Project/SyncGenerator.h') diff --git a/Project/SyncGenerator.h b/Project/SyncGenerator.h index a672a4f..c23cb2e 100644 --- a/Project/SyncGenerator.h +++ b/Project/SyncGenerator.h @@ -4,6 +4,7 @@ #include "Machines.h" class SyncMachineForm; +class ControlElementContainer; struct SyncGeneratorElectricalData { // General @@ -59,6 +60,10 @@ struct SyncGeneratorElectricalData { double subXq = 0.0; double subTd0 = 0.0; double subTq0 = 0.0; + + //Control + ControlElementContainer* avr = NULL; + ControlElementContainer* speedGov = NULL; }; class SyncGenerator : public Machines -- cgit From 1158ce068e3b5b391604270bf10c52d0d2f7f4db Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Tue, 16 May 2017 19:07:49 -0300 Subject: Sync generator control fixed --- Project/SyncGenerator.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'Project/SyncGenerator.h') diff --git a/Project/SyncGenerator.h b/Project/SyncGenerator.h index c23cb2e..282d9fa 100644 --- a/Project/SyncGenerator.h +++ b/Project/SyncGenerator.h @@ -36,8 +36,8 @@ struct SyncGeneratorElectricalData { double groundReactance = 0.0; bool groundNeutral = true; // p.u. fault data - std::complex faultCurrent[3] = { std::complex(0.0, 0.0), std::complex(0.0, 0.0), - std::complex(0.0, 0.0) }; + std::complex faultCurrent[3] = {std::complex(0.0, 0.0), std::complex(0.0, 0.0), + std::complex(0.0, 0.0)}; // Stability bool plotSyncMachine = false; @@ -60,20 +60,20 @@ struct SyncGeneratorElectricalData { double subXq = 0.0; double subTd0 = 0.0; double subTq0 = 0.0; - - //Control + + // Control ControlElementContainer* avr = NULL; ControlElementContainer* speedGov = NULL; }; class SyncGenerator : public Machines { -public: + public: SyncGenerator(); SyncGenerator(wxString name); ~SyncGenerator(); - - virtual Element* GetCopy(); + + virtual Element* GetCopy(); virtual void Init(); virtual void DrawSymbol() const; virtual bool GetContextMenu(wxMenu& menu); @@ -83,10 +83,11 @@ public: virtual SyncGeneratorElectricalData GetPUElectricalData(double systemPowerBase); virtual void SetElectricalData(SyncGeneratorElectricalData electricalData) { m_electricalData = electricalData; } virtual void SetNominalVoltage(std::vector nominalVoltage, std::vector nominalVoltageUnit); -protected: + + protected: std::vector m_sinePts; SyncGeneratorElectricalData m_electricalData; }; -#endif // SYNCGENERATOR_H +#endif // SYNCGENERATOR_H -- cgit From f995850b38916b38718b84f4b82948479a81855a Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Mon, 22 May 2017 20:17:41 -0300 Subject: Events implemented Effects on adimittance matrix and elements: ->Fault on bus; ->Generation/Load switching; ->Branch switching. --- Project/SyncGenerator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Project/SyncGenerator.h') diff --git a/Project/SyncGenerator.h b/Project/SyncGenerator.h index 282d9fa..5fe078f 100644 --- a/Project/SyncGenerator.h +++ b/Project/SyncGenerator.h @@ -23,7 +23,7 @@ struct SyncGeneratorElectricalData { bool haveMinReactive = false; double minReactive = -9999.0; ElectricalUnit minReactiveUnit = UNIT_MVAr; - bool useMachineBase = false; + bool useMachineBase = true; // Fault double positiveResistance = 0.0; -- cgit From c91e58bb903adeff1e8c0fff1868e80783010e58 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 24 May 2017 17:50:36 -0300 Subject: Dynamic elements initialization implemented --- Project/SyncGenerator.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'Project/SyncGenerator.h') diff --git a/Project/SyncGenerator.h b/Project/SyncGenerator.h index 5fe078f..8cadddc 100644 --- a/Project/SyncGenerator.h +++ b/Project/SyncGenerator.h @@ -5,6 +5,7 @@ class SyncMachineForm; class ControlElementContainer; +class ControlElementSolver; struct SyncGeneratorElectricalData { // General @@ -61,9 +62,44 @@ struct SyncGeneratorElectricalData { double subTd0 = 0.0; double subTq0 = 0.0; + // Machine state variables + std::complex terminalVoltage; + std::vector > terminalVoltageVector; + std::complex electricalPower; + std::vector > electricalPowerVector; + double pm; + std::vector mechanicalPowerVector; + double speed; + std::vector freqVector; + double fieldVoltage; + std::vector fieldVoltageVector; + double delta; + std::vector deltaVector; + + double initialFieldVoltage; + + // Internal machine variables + double tranEq; + double tranEd; + double subEq; + double subEd; + double pe; + + // Integration constants + IntegrationConstant icSpeed; + IntegrationConstant icDelta; + IntegrationConstant icTranEq; + IntegrationConstant icTranEd; + IntegrationConstant icSubEq; + IntegrationConstant icSubEd; + // Control ControlElementContainer* avr = NULL; ControlElementContainer* speedGov = NULL; + + // Control solvers + ControlElementSolver* avrSolver = NULL; + ControlElementSolver* speedGovSolver = NULL; }; class SyncGenerator : public Machines -- cgit From 734476bea0a2b85b131f5a4d2c9e2b219af7be41 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Fri, 26 May 2017 02:21:15 -0300 Subject: Sync generator plot implemented Electromechanical calc not working --- Project/SyncGenerator.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Project/SyncGenerator.h') diff --git a/Project/SyncGenerator.h b/Project/SyncGenerator.h index 8cadddc..9929175 100644 --- a/Project/SyncGenerator.h +++ b/Project/SyncGenerator.h @@ -42,7 +42,7 @@ struct SyncGeneratorElectricalData { // Stability bool plotSyncMachine = false; - double inertia = 0.0; + double inertia = 1.0; double damping = 0.0; bool useAVR = false; bool useSpeedGovernor = false; @@ -119,6 +119,7 @@ class SyncGenerator : public Machines virtual SyncGeneratorElectricalData GetPUElectricalData(double systemPowerBase); virtual void SetElectricalData(SyncGeneratorElectricalData electricalData) { m_electricalData = electricalData; } virtual void SetNominalVoltage(std::vector nominalVoltage, std::vector nominalVoltageUnit); + virtual bool GetPlotData(ElementPlotData& plotData); protected: std::vector m_sinePts; -- cgit From 4ca362b083d7b20adfd80f1ec4b46a52789cdeb7 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Mon, 17 Jul 2017 21:02:07 -0300 Subject: Some optimization, model 1 machine implementation start --- Project/SyncGenerator.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Project/SyncGenerator.h') diff --git a/Project/SyncGenerator.h b/Project/SyncGenerator.h index 9929175..b5c7737 100644 --- a/Project/SyncGenerator.h +++ b/Project/SyncGenerator.h @@ -96,10 +96,12 @@ struct SyncGeneratorElectricalData { // Control ControlElementContainer* avr = NULL; ControlElementContainer* speedGov = NULL; - + // Control solvers ControlElementSolver* avrSolver = NULL; ControlElementSolver* speedGovSolver = NULL; + + Machines::SyncMachineModel model = Machines::SM_MODEL_1; }; class SyncGenerator : public Machines -- cgit From 49ac4c4fcedb03ef09f8faab176159f48896dc7e Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 26 Jul 2017 21:32:35 -0300 Subject: 5 machine models implemented --- Project/SyncGenerator.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Project/SyncGenerator.h') diff --git a/Project/SyncGenerator.h b/Project/SyncGenerator.h index b5c7737..fb5ffdc 100644 --- a/Project/SyncGenerator.h +++ b/Project/SyncGenerator.h @@ -84,6 +84,11 @@ struct SyncGeneratorElectricalData { double subEq; double subEd; double pe; + + // Variables to extrapolate + double oldId; + double oldIq; + double oldPe; // Integration constants IntegrationConstant icSpeed; -- cgit