pySimBlocks.blocks.controllers.pid¶
- class pySimBlocks.blocks.controllers.pid.Pid(name: str, controller: str = 'PID', Kp: ArrayLike = 0.0, Ki: ArrayLike = 0.0, Kd: ArrayLike = 0.0, u_min: TypeAliasForwardRef('ArrayLike') | None = None, u_max: TypeAliasForwardRef('ArrayLike') | None = None, integration_method: str = 'euler forward', sample_time: float | None = None)[source]¶
Bases:
BlockDiscrete-time PID controller block.
Implements a single-input single-output discrete PID controller, similar to the Simulink PID block. The controller computes a control command from an error signal
eusing proportional, integral, and/or derivative actions depending on the selected control mode.Output saturation is applied only if
u_minand/oru_maxare set. Anti-windup clamps the integrator state to the saturation bounds.- controller¶
Active control mode (
"P","I","PI","PD", or"PID").
- integration_method¶
Integration scheme for the I term (
"euler forward"or"euler backward").
- Kp¶
Proportional gain as a (1,1) array.
- Ki¶
Integral gain as a (1,1) array.
- Kd¶
Derivative gain as a (1,1) array.
- u_min¶
Lower saturation bound as a (1,1) array, or None.
- u_max¶
Upper saturation bound as a (1,1) array, or None.
- initialize(t0: float) None[source]¶
Set the output to zero and keep internal states at zero.
- Parameters:
t0 – Initial simulation time in seconds.