PI Speed Controller

class gem_controllers.pi_speed_controller.PISpeedController(_env: (<class 'gym_electric_motor.core.ElectricMotorEnvironment'>, None) = None, env_id: (<class 'str'>, None) = None, torque_controller: (<class 'gem_controllers.torque_controller.TorqueController'>, None) = None, base_speed_controller: str = 'PI')[source]

This class forms the PI speed controller, for any motor.

Initilizes a PI speed control stage.

Parameters
  • _env (ElectricMotorEnvironment) – The GEM-Environment that the controller shall be created for.

  • env_id (str) – The corresponding environment-id to specify the concrete environment.

  • torque_controller (gc.TorqueController) – The underlying torque control stage

  • base_speed_controller (str) – Selection which base controller should be used for the speed control stage.

property anti_windup_stage

Anti windup stage of the speed controller

property clipping_stage

Clipping stage of the speed controller

control(state, reference)[source]

Claculate the reference values for the input voltages.

Parameters
  • state (np.array) – actual state of the environment

  • reference (np.array) – speed references

Returns

voltage reference

Return type

np.ndarray

reset()[source]

Reset all components of the speed control stage and the underlying control stages

speed_control(state, reference)[source]

Calculate the torque reference.

Parameters
  • state (np.array) – actual state of the environment

  • reference (np.array) – actual speed references

Returns

torque_reference(np.array)

property speed_control_stage: BaseController

Base controller of the speed controller stage

property torque_controller: TorqueController

Subordinated torque controller stage

property torque_reference: ndarray

Reference values of the torque controller stage

tune(env, env_id, tune_torque_controller=True, a=4, **kwargs)[source]

Tune the components of the current control stage.

Parameters
  • env (ElectricMotorEnvironment) – The GEM-Environment that the controller shall be created for.

  • env_id (str) – The corresponding environment-id to specify the concrete environment.

  • tune_torque_controller (bool) – Flag, if the underlying torque control stage should be tuned.

  • a (float) – Design parameter of the symmetric optimum for the base controllers