wecopttool.pto.controller_pid

controller_pid(pto, wec, x_wec, x_opt, waves=None, nsubsteps=1, proportional=True, integral=True, derivative=True, saturation=None)[source]

Proportional-integral-derivative (PID) controller that returns a time history of PTO forces.

Parameters:
  • pto (PTO) – wecopttool.pto.PTO object.

  • wec (WEC) – wecopttool.WEC object.

  • x_wec (ndarray) – WEC dynamic state.

  • x_opt (ndarray) – Optimization (control) state.

  • waves (Dataset | None) – xarray.Dataset with the structure and elements shown by wecopttool.waves.

  • nsubsteps (int | None) – Number of steps between the default (implied) time steps. A value of 1 corresponds to the default step length.

  • proportional (bool | None) – True to include proportional gain

  • integral (bool | None) – True to include integral gain

  • derivative (bool | None) – True to include derivative gain

  • saturation (FloatOrArray | None) – Maximum and minimum control value. Can be symmetric ([ndof]) or asymmetric ([ndof, 2]).

Return type:

ndarray