|
| template<typename Param > |
| | PID (Param &&PARAM) |
| | 构造 PID 控制器。 Construct a PID controller.
|
| |
| Scalar | Calculate (Scalar sp, Scalar fb, Scalar dt) |
| | 使用反馈值计算 PID 输出。 Compute output from feedback only. out = k(p*err + i*∫err*dt - d*(fb-last_fb)/dt)
|
| |
| Scalar | Calculate (Scalar sp, Scalar fb, Scalar fb_dot, Scalar dt) |
| | 使用外部导数计算 PID 输出。 Compute output using external feedback derivative. out = k(p*err + i*∫err*dt - d*fb_dot*dt)
|
| |
| void | SetK (Scalar k) |
| | 设置全局比例系数 Set global proportional gain
|
| |
| void | SetP (Scalar p) |
| | 设置 P 项系数 Set proportional gain
|
| |
| void | SetI (Scalar i) |
| | 设置 I 项系数 Set integral gain
|
| |
| void | SetD (Scalar d) |
| | 设置 D 项系数 Set derivative gain
|
| |
| void | SetILimit (Scalar limit) |
| | 设置积分限幅 Set integral limit
|
| |
| void | SetOutLimit (Scalar limit) |
| | 设置输出限幅 Set output limit
|
| |
| Scalar | K () const |
| | 获取全局比例系数 Get global proportional gain
|
| |
| Scalar | P () const |
| | 获取 P 项系数 Get proportional gain
|
| |
| Scalar | I () const |
| | 获取 I 项系数 Get integral gain
|
| |
| Scalar | D () const |
| | 获取 D 项系数 Get derivative gain
|
| |
| Scalar | ILimit () const |
| | 获取积分限幅 Get integral limit
|
| |
| Scalar | OutLimit () const |
| | 获取输出限幅 Get output limit
|
| |
| Scalar | LastError () const |
| | 获取上一次误差 Get last error
|
| |
| Scalar | LastFeedback () const |
| | 获取上一次反馈值 Get last feedback
|
| |
| Scalar | LastOutput () const |
| | 获取上一次输出 Get last output
|
| |
| Scalar | LastDerivative () const |
| | 获取上一次导数 Get last derivative
|
| |
| void | Reset () |
| | 重置控制器状态。 Reset all internal states.
|
| |
| void | SetIntegralError (Scalar err) |
| | 设置累计误差 Set integral error
|
| |
| Scalar | GetIntegralError () const |
| | 获取累计误差 Get integral error
|
| |
| void | SetFeedForward (Scalar feed_forward) |
| | 设置前馈项 Set feedforward
|
| |
| Scalar | GetFeedForward () const |
| | 获取前馈项 Get feedforward
|
| |
template<typename Scalar = DefaultScalar>
class LibXR::PID< Scalar >
通用 PID 控制器类。 Generic PID controller.
支持周期角度处理、积分限幅与输出限幅,适用于基础控制应用。 Supports cyclic inputs, integral/output saturation. No derivative filtering.
- Template Parameters
-
| Scalar | 控制器标量类型,默认为 DefaultScalar。 Scalar type for internal calculations. |
Definition at line 26 of file pid.hpp.