Permanent Magnet Synchronous Motor Operation Point Selection

class gem_controllers.stages.operation_point_selection.pmsm_ops.PMSMOperationPointSelection(torque_control='online', max_modulation_level: float = 1.1547005383792517, modulation_damping: float = 1.2)[source]

This class represents the operation point selection of the torque controller for cascaded control of synchronous motors. For low speeds only the current limitation of the motor is important. The current vector to set a desired torque is selected so that the amount of the current vector is minimum (Maximum Torque per Current). For higher speeds, the voltage limitation of the synchronous motor or the actuator must also be taken into account. This is done by converting the available voltage to a speed-dependent maximum flux. An additional modulation controller is used for the flux control. By limiting the flux and the maximum torque per flux (MTPF), an operating point for the flux and the torque is obtained. This is then converted into a current operating point. The conversion can be done by different methods (parameter torque_control). On the one hand, maps can be determined in advance by interpolation or analytically, or the analytical determination can be done online.

Parameters
  • torque_control (str) – Methode for the operation point selection.

  • max_modulation_level (float) – Maximum value for the modulation controller.

  • modulation_damping (float) – Damping of the gain of the modulation controller.

_get_i_d_q(torque, psi, psi_idx)[source]

Get the i_d and i_q current from the MTPC lut

_get_mtpc_lookup_table()[source]

Calculate the lookup tables, that maps a pair of torque and flux on a current operation point.

_get_mtpf_lookup_table()[source]

Calculate the lookup table that maps a flux on a maximum torque.

_get_psi_idx(psi)[source]

Get the index of the flux.

_get_psi_idx_mtpf(psi)[source]

Get the index of the flux of the MTPF lookup table.

_get_t_idx(torque)[source]

Get the index of the torque.

_get_t_idx_mtpc(torque)[source]

Get the index of the torque of the mtpc lookup table.

_select_operating_point(state, reference)[source]

Calculate the current operation point for a given torque reference value.

Parameters
  • state (np.ndarray) – The state of the environment.

  • reference (np.ndarray) – The reference of the state.

Returns

references for the current control stage

Return type

current_reference(np.ndarray)

reset()[source]

Reset the PMSM operation point selection

solve_analytical(torque, psi)[source]

Assuming linear magnetization characteristics, the optimal currents for given reference and flux can be obtained by solving the reference and flux equations. These lead to a fourth degree polynomial which can be solved analytically. There are two ways to use this analytical solution for control. On the one hand, the currents can be determined in advance as in the case of interpolation for different torques and fluxes and stored in a LUT (torque_control=’analytical’). On the other hand, the solution can be calculated at runtime with the given reference and flux (torque_control=’online’).

Parameters
  • torque (float) – The torque reference value.

  • psi (float) – The optimal flux value.

Returns

optimal $i_{sd}$ current i_q(flaot): optimal $i_{sq}$ current

Return type

i_d(float)

tune(env: ElectricMotorEnvironment, env_id: str, current_safety_margin: float = 0.2)[source]

Tune the operation point selcetion stage.

Parameters
  • env (gym_electric_motor.ElectricMotorEnvironment) – The environment to be controlled.

  • env_id (str) – The id of the environment.

  • current_safety_margin (float) – Percentage of the current margin to the current limit.