Shortcuts

Warning

This page was created from a pull request (#250).

pypose.module.PID

class pypose.module.PID(kp, ki, kd)[source]

This class is the basic implementation of PID controller.

A PID controller, standing for proportional-integral-derivative controller, operates as a feedback mechanism within a control loop, extensively utilized across industrial control systems and various applications where continuous modulation is essential. It functions by persistently determining an error value \(\mathbf{e}(t)\), which represents the difference between a targeted setpoint and the actual value of the process being controlled. To correct this error, the PID controller implements adjustments derived from three key components: the proportional term (P), the integral term (I), and the derivative term (D), each contributing to the overall control strategy.

Parameters:
  • kp (Tensor) – proportional gain to the error

  • ki (Tensor) – integral gain to the integration of the error over the past time

  • kd (Tensor) – derivative gain to the current rate of change of the error

The output of the PID can be described as

\[\mathbf{u}(t) = \mathbf{K_p} \mathbf{e}(t) + \mathbf{K_i} \int_0^t \mathbf{e}(\tau)d \tau + \mathbf{K_d} \frac{d\mathbf{e}(t)}{dt} \]

The discritized implmentation of the PID can be described as

\[\mathbf{u}(t_k) = \mathbf{K_p} \mathbf{e}(t_k) + \mathbf{K_i} \sum_{j=0}^k \mathbf{e}(t_j) + \mathbf{K_d} (\mathbf{e}(t_k) - \mathbf{e}(t_{k-1})) \]
forward(error, error_dot, ff=None)[source]
Parameters:
  • error – error value \(\mathbf{e}(t)\) as the difference between a desired setpoint and a measured value.

  • error_dot – The rate of the change of error value.

  • ff – feedforward system input appened to the output of the pid controller

reset()[source]

This method is used to reset the internal error integrity.

Docs

Access documentation for PyPose

View Docs

Tutorials

Get started with tutorials and examples

View Tutorials

Get Started

Find resources and how to start using pypose

View Resources