diff --git a/src/gym_electric_motor/envs/gym_eesm/cont_cc_eesm_env.py b/src/gym_electric_motor/envs/gym_eesm/cont_cc_eesm_env.py index 06b842fd..9a02b76e 100644 --- a/src/gym_electric_motor/envs/gym_eesm/cont_cc_eesm_env.py +++ b/src/gym_electric_motor/envs/gym_eesm/cont_cc_eesm_env.py @@ -157,7 +157,7 @@ def __init__( ps.ContFourQuadrantConverter(), ) physical_system = ExternallyExcitedSynchronousMotorSystem( - supply=initialize(ps.VoltageSupply, supply, ps.IdealVoltageSupply, dict(u_nominal=300.0)), + supply=initialize(ps.VoltageSupply, supply, ps.IdealVoltageSupply, dict(u_nominal=200.0)), converter=initialize( ps.PowerElectronicConverter, converter, diff --git a/src/gym_electric_motor/envs/gym_eesm/cont_sc_eesm_env.py b/src/gym_electric_motor/envs/gym_eesm/cont_sc_eesm_env.py index cb01c0a2..2686db56 100644 --- a/src/gym_electric_motor/envs/gym_eesm/cont_sc_eesm_env.py +++ b/src/gym_electric_motor/envs/gym_eesm/cont_sc_eesm_env.py @@ -150,7 +150,7 @@ def __init__( ps.ContFourQuadrantConverter(), ) physical_system = ExternallyExcitedSynchronousMotorSystem( - supply=initialize(ps.VoltageSupply, supply, ps.IdealVoltageSupply, dict(u_nominal=420.0)), + supply=initialize(ps.VoltageSupply, supply, ps.IdealVoltageSupply, dict(u_nominal=200.0)), converter=initialize( ps.PowerElectronicConverter, converter, diff --git a/src/gym_electric_motor/envs/gym_eesm/cont_tc_eesm_env.py b/src/gym_electric_motor/envs/gym_eesm/cont_tc_eesm_env.py index e8f4be5a..9da0a717 100644 --- a/src/gym_electric_motor/envs/gym_eesm/cont_tc_eesm_env.py +++ b/src/gym_electric_motor/envs/gym_eesm/cont_tc_eesm_env.py @@ -154,7 +154,7 @@ def __init__( ps.ContFourQuadrantConverter(), ) physical_system = ExternallyExcitedSynchronousMotorSystem( - supply=initialize(ps.VoltageSupply, supply, ps.IdealVoltageSupply, dict(u_nominal=420.0)), + supply=initialize(ps.VoltageSupply, supply, ps.IdealVoltageSupply, dict(u_nominal=200.0)), converter=initialize( ps.PowerElectronicConverter, converter, diff --git a/src/gym_electric_motor/envs/gym_eesm/finite_cc_eesm_env.py b/src/gym_electric_motor/envs/gym_eesm/finite_cc_eesm_env.py index c165d8f5..7514566e 100644 --- a/src/gym_electric_motor/envs/gym_eesm/finite_cc_eesm_env.py +++ b/src/gym_electric_motor/envs/gym_eesm/finite_cc_eesm_env.py @@ -157,7 +157,7 @@ def __init__( ps.FiniteFourQuadrantConverter(), ) physical_system = ExternallyExcitedSynchronousMotorSystem( - supply=initialize(ps.VoltageSupply, supply, ps.IdealVoltageSupply, dict(u_nominal=420.0)), + supply=initialize(ps.VoltageSupply, supply, ps.IdealVoltageSupply, dict(u_nominal=200.0)), converter=initialize( ps.PowerElectronicConverter, converter, diff --git a/src/gym_electric_motor/envs/gym_eesm/finite_sc_eesm_env.py b/src/gym_electric_motor/envs/gym_eesm/finite_sc_eesm_env.py index a8296e21..95f05efc 100644 --- a/src/gym_electric_motor/envs/gym_eesm/finite_sc_eesm_env.py +++ b/src/gym_electric_motor/envs/gym_eesm/finite_sc_eesm_env.py @@ -149,7 +149,7 @@ def __init__( ps.FiniteFourQuadrantConverter(), ) physical_system = ExternallyExcitedSynchronousMotorSystem( - supply=initialize(ps.VoltageSupply, supply, ps.IdealVoltageSupply, dict(u_nominal=420.0)), + supply=initialize(ps.VoltageSupply, supply, ps.IdealVoltageSupply, dict(u_nominal=200.0)), converter=initialize( ps.PowerElectronicConverter, converter, diff --git a/src/gym_electric_motor/envs/gym_eesm/finite_tc_eesm_env.py b/src/gym_electric_motor/envs/gym_eesm/finite_tc_eesm_env.py index 701dca99..3902b7a8 100644 --- a/src/gym_electric_motor/envs/gym_eesm/finite_tc_eesm_env.py +++ b/src/gym_electric_motor/envs/gym_eesm/finite_tc_eesm_env.py @@ -149,7 +149,7 @@ def __init__( ps.FiniteFourQuadrantConverter(), ) physical_system = ExternallyExcitedSynchronousMotorSystem( - supply=initialize(ps.VoltageSupply, supply, ps.IdealVoltageSupply, dict(u_nominal=420.0)), + supply=initialize(ps.VoltageSupply, supply, ps.IdealVoltageSupply, dict(u_nominal=200.0)), converter=initialize( ps.PowerElectronicConverter, converter, diff --git a/src/gym_electric_motor/physical_systems/electric_motors/externally_excited_synchronous_motor.py b/src/gym_electric_motor/physical_systems/electric_motors/externally_excited_synchronous_motor.py index 20957790..7abab9f1 100644 --- a/src/gym_electric_motor/physical_systems/electric_motors/externally_excited_synchronous_motor.py +++ b/src/gym_electric_motor/physical_systems/electric_motors/externally_excited_synchronous_motor.py @@ -97,21 +97,21 @@ class ExternallyExcitedSynchronousMotor(SynchronousMotor): CURRENTS = ["i_sd", "i_sq", "i_e"] VOLTAGES = ["u_sd", "u_sq", "u_e"] - #### Parameters taken from DOI: 10.1109/ICELMACH.2014.6960287 (C. D. Nguyen; W. Hofmann) + #### Parameters derived from DOI: 10.1109/ICPE.2015.7168165 (Q. K. Nguyen; J. Schuster; J. Roth-Stielow) _default_motor_parameter = { - 'p': 3, - 'l_d': 1.66e-3, - 'l_q': 0.35e-3, - 'l_m': 1.589e-3, - 'l_e': 1.74e-3, + 'p': 2, + 'l_d': 3.78e-3, + 'l_q': 1.21e-3, + 'l_m': 40e-3, + 'l_e': 870e-3, 'j_rotor': 0.3883, - 'r_s': 15.55e-3, - 'r_e': 7.2e-3, - 'k': 65.21, + 'r_s': 123e-3, + 'r_e': 15.6, + 'k': 0.057, } HAS_JACOBIAN = True - _default_limits = dict(omega=12e3 * np.pi / 30, torque=0.0, i=150, i_e=150, epsilon=math.pi, u=320) - _default_nominal_values = dict(omega=4.3e3 * np.pi / 30, torque=0.0, i=120, i_e=150, epsilon=math.pi, u=320) + _default_limits = dict(omega=12e3 * np.pi / 30, torque=0.0, i=25, i_e=25, epsilon=math.pi, u=200, u_e=200) + _default_nominal_values = dict(omega=4.3e3 * np.pi / 30, torque=0.0, i=25, i_e=25, epsilon=math.pi, u=200, u_e=200) _default_initializer = { "states": {"i_sq": 0.0, "i_sd": 0.0, "i_e": 0.0, "epsilon": 0.0}, "interval": None, @@ -126,10 +126,30 @@ def _update_model(self): # Docstring of superclass mp = self._motor_parameter - # Transform rotor quantities to stator side (uppercase index denotes transformation to stator side) - mp['r_E'] = mp['k'] ** 2 * 3/2 * mp['r_e'] - mp['l_M'] = mp['k'] * 3/2 * mp['l_m'] - mp['l_E'] = mp['k'] ** 2 * 3/2 * mp['l_e'] + if all(key in mp for key in ['r_e', 'l_m', 'l_e']): + print("Transforming r_e, l_m and l_e to stator side.") + print("To specify stator-side quantities, make use of keys r_E, l_M and l_E instead.") + + # Transform rotor quantities to stator side (uppercase index denotes transformation to stator side) + mp['r_E'] = 3 / 2 * mp['k'] ** 2 * mp['r_e'] + mp['l_M'] = 3 / 2 * mp['k'] * mp['l_m'] + mp['l_E'] = 3 / 2 * mp['k'] ** 2 * mp['l_e'] + + elif all(key in mp for key in ['r_E', 'l_M', 'l_E']): + + if mp != self._default_motor_parameter: + print("Assuming r_E, l_M and l_E are already transformed to stator side.") + print("To specify rotor-side quantities, make use of keys r_e, l_m and l_e instead.") + + # Transform rotor quantities to rotor side (only for completing the mp dict, not needed for calculation) + mp['r_e'] = 2 / 3 * mp['r_E'] / (mp['k'] ** 2) + mp['l_m'] = 2 / 3 * mp['l_M'] / mp['k'] + mp['l_e'] = 2 / 3 * mp['l_E'] / (mp['k'] ** 2) + + else: + raise KeyError("Rotor quantities are not specified in a consistent frame or are incomplete." + "Specify either r_e, l_m and l_e (rotor-side) or r_E, l_M and l_E (stator-side).") + mp['i_k_rs'] = 2 / 3 / mp['k'] # ratio (i_E / i_e) mp['sigma'] = 1 - mp['l_M'] ** 2 / (mp['l_d'] * mp['l_E']) @@ -137,7 +157,7 @@ def _update_model(self): # fmt: off self._model_constants = np.array([ - # omega, i_d, i_q, i_e, u_d, u_q, u_e, omega * i_d, omega * i_q, omega * i_e + # omega, i_d, i_q, i_e, u_d, u_q, u_e, omega * i_d, omega * i_q, omega * i_e [ 0, -mp["r_s"] / mp["sigma"], 0, mp["l_M"] * mp["r_E"] / (mp["sigma"] * mp["l_E"]) * mp["i_k_rs"], 1 / mp["sigma"], 0, -mp["l_M"] * mp["k"] / (mp["sigma"] * mp["l_E"]), 0, mp["l_q"] * mp["p"] / mp["sigma"], 0], [ 0, 0, -mp["r_s"], 0, 0, 1, 0, -mp["l_d"] * mp["p"], 0, -mp["p"] * mp["l_M"] * mp["i_k_rs"]], [ 0, mp["l_M"] * mp["r_s"] / (mp["sigma"] * mp["l_d"]), 0, -mp["r_E"] / mp["sigma"] * mp["i_k_rs"], -mp["l_M"] / (mp["sigma"] * mp["l_d"]), 0, mp["k"] / mp["sigma"], 0, -mp["p"] * mp["l_M"] * mp["l_q"] / (mp["sigma"] * mp["l_d"]), 0],