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 errorki (
Tensor
) – integral gain to the integration of the error over the past timekd (
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})) \]