From f54297e08079fe1954920ca2742b0bed19f86181 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 10 Jul 2019 14:14:30 -0300 Subject: Induction motor implementation start Machine initialization implemented. It seems that it's working. Check a OMIB with the motor. --- Project/IndMotor.h | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'Project/IndMotor.h') diff --git a/Project/IndMotor.h b/Project/IndMotor.h index c210279..3f5009a 100644 --- a/Project/IndMotor.h +++ b/Project/IndMotor.h @@ -24,10 +24,67 @@ class IndMotorForm; struct IndMotorElectricalData { wxString name; + double ratedPower = 100.0; + ElectricalUnit ratedPowerUnit = UNIT_MVA; double activePower = 100.0; ElectricalUnit activePowerUnit = UNIT_MW; double reactivePower = 0.0; ElectricalUnit reactivePowerUnit = UNIT_MVAr; + + bool useMachinePowerAsBase = true; + + // Stability + double inertia = 1.0; // Motor and load inertia + double s0; // Initial slip + double q0; // Initial reactive power + double r1 = 0.0; // Stator resistence data + double x1 = 1.0; // Stator reactance data + double r2 = 1.0; // Rotor resistence data + double x2 = 0.0; // Rotor reactance data + double xm = 100.0; // Magnetizing reactance data + + // Transient values + double xt = 1.0; // Transient reactance + double x0 = 1.0; // Open-circuit reactance + double r1t = 0.0; // Stator resistence in system power base + double x1t = 1.0; // Stator reactance in system power base + double r2t = 1.0; // Rotor resistence in system power base + double x2t = 0.0; // Rotor reactance in system power base + double xmt = 100.0; // Magnetizing reactance in system power base + + double t0 = 1.0; // Open-circuit time constant + + double aw = 1.0; // Velocity constant torque + double bw = 0.0; // Velocity linear dependent torque + double cw = 0.0; // Velocity quadratic dependent torque + double as = 0.0; // Slip constant torque + double bs = 0.0; // Slip linear dependent torque + double cs = 0.0; // Slip quadratic dependent torque + + // Internal machine variables + double tranEr; + double tranEm; + double te; + double ir; + double im; + + // Variables to extrapolate + double oldIr; + double oldIm; + double oldTe; + + // Integration constants + IntegrationConstant icSlip; + IntegrationConstant icTranEr; + IntegrationConstant icTranEm; + + // Machine state variables + std::complex terminalVoltage; + std::vector terminalVoltageVector; + double slip = 1.0; // Machine slip + std::vector slipVector; + std::complex electricalPower; + std::vector > electricalPowerVector; }; /** -- cgit From ec20e2ac95f8a5013f2293a7a2a96016fb805581 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Thu, 11 Jul 2019 18:06:08 -0300 Subject: Induction motor DAE implemented Need some testing Check inertia --- Project/IndMotor.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Project/IndMotor.h') diff --git a/Project/IndMotor.h b/Project/IndMotor.h index 3f5009a..98e3414 100644 --- a/Project/IndMotor.h +++ b/Project/IndMotor.h @@ -34,6 +34,7 @@ struct IndMotorElectricalData { bool useMachinePowerAsBase = true; // Stability + bool plotIndMachine = true; double inertia = 1.0; // Motor and load inertia double s0; // Initial slip double q0; // Initial reactive power @@ -64,7 +65,6 @@ struct IndMotorElectricalData { // Internal machine variables double tranEr; double tranEm; - double te; double ir; double im; @@ -83,6 +83,9 @@ struct IndMotorElectricalData { std::vector terminalVoltageVector; double slip = 1.0; // Machine slip std::vector slipVector; + double te; + std::vector electricalTorqueVector; + std::vector mechanicalTorqueVector; std::complex electricalPower; std::vector > electricalPowerVector; }; @@ -109,6 +112,8 @@ class IndMotor : public Machines virtual IndMotorElectricalData GetElectricalData() { return m_electricalData; } virtual IndMotorElectricalData GetPUElectricalData(double systemPowerBase); virtual void SetElectricalData(IndMotorElectricalData electricalData) { m_electricalData = electricalData; } + + virtual bool GetPlotData(ElementPlotData& plotData, PlotStudy study = STABILITY); virtual rapidxml::xml_node<>* SaveElement(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementListNode); virtual bool OpenElement(rapidxml::xml_node<>* elementNode, std::vector parentList); -- cgit From fed838330b39f69a682b64b1b885fec17ff901d7 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Fri, 12 Jul 2019 02:03:28 -0300 Subject: Motor start implemented and bugfixes --- Project/IndMotor.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Project/IndMotor.h') diff --git a/Project/IndMotor.h b/Project/IndMotor.h index 98e3414..4137e6f 100644 --- a/Project/IndMotor.h +++ b/Project/IndMotor.h @@ -86,6 +86,8 @@ struct IndMotorElectricalData { double te; std::vector electricalTorqueVector; std::vector mechanicalTorqueVector; + std::vector velocityVector; + std::vector currentVector; std::complex electricalPower; std::vector > electricalPowerVector; }; -- cgit From 4d4f39cb101bb0ccb1d336587a9e143b392dbefc Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Sat, 13 Jul 2019 01:14:14 -0300 Subject: Multiple motor initialization implemented --- Project/IndMotor.h | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'Project/IndMotor.h') diff --git a/Project/IndMotor.h b/Project/IndMotor.h index 4137e6f..760a65a 100644 --- a/Project/IndMotor.h +++ b/Project/IndMotor.h @@ -34,7 +34,7 @@ struct IndMotorElectricalData { bool useMachinePowerAsBase = true; // Stability - bool plotIndMachine = true; + bool plotIndMachine = false; double inertia = 1.0; // Motor and load inertia double s0; // Initial slip double q0; // Initial reactive power @@ -43,15 +43,17 @@ struct IndMotorElectricalData { double r2 = 1.0; // Rotor resistence data double x2 = 0.0; // Rotor reactance data double xm = 100.0; // Magnetizing reactance data + double kf = 0.0; // Cage factor + bool useKf = false; // Transient values double xt = 1.0; // Transient reactance double x0 = 1.0; // Open-circuit reactance double r1t = 0.0; // Stator resistence in system power base - double x1t = 1.0; // Stator reactance in system power base - double r2t = 1.0; // Rotor resistence in system power base - double x2t = 0.0; // Rotor reactance in system power base - double xmt = 100.0; // Magnetizing reactance in system power base + double x1t = 1.0; // Stator reactance in system power base + double r2t = 1.0; // Rotor resistence in system power base + double x2t = 0.0; // Rotor reactance in system power base + double xmt = 100.0; // Magnetizing reactance in system power base double t0 = 1.0; // Open-circuit time constant @@ -63,15 +65,15 @@ struct IndMotorElectricalData { double cs = 0.0; // Slip quadratic dependent torque // Internal machine variables - double tranEr; - double tranEm; - double ir; - double im; + double tranEr = 0.0; + double tranEm = 0.0; + double ir = 0.0; + double im = 0.0; // Variables to extrapolate - double oldIr; - double oldIm; - double oldTe; + double oldIr = 0.0; + double oldIm = 0.0; + double oldTe = 0.0; // Integration constants IntegrationConstant icSlip; @@ -88,8 +90,8 @@ struct IndMotorElectricalData { std::vector mechanicalTorqueVector; std::vector velocityVector; std::vector currentVector; - std::complex electricalPower; - std::vector > electricalPowerVector; + std::vector activePowerVector; + std::vector reactivePowerVector; }; /** @@ -114,7 +116,7 @@ class IndMotor : public Machines virtual IndMotorElectricalData GetElectricalData() { return m_electricalData; } virtual IndMotorElectricalData GetPUElectricalData(double systemPowerBase); virtual void SetElectricalData(IndMotorElectricalData electricalData) { m_electricalData = electricalData; } - + virtual bool GetPlotData(ElementPlotData& plotData, PlotStudy study = STABILITY); virtual rapidxml::xml_node<>* SaveElement(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementListNode); -- cgit