Generic proportional-derivative control (for use in a motor, look at the Motor controller library instead)
More...
#include <WMath.h>
Generic proportional-derivative control (for use in a motor, look at the Motor controller library instead)
|
virtual float | update (float pos, float setpoint) |
| Computes the PD control from the given error. More...
|
|
void | setGain (float Kp, float Kd) |
| Set gains. More...
|
|
virtual void | init (float smooth, float freq, DLPFType type) |
| Initialize filter. More...
|
|
virtual float | update (float val) |
| Call this at the rate given in freq in init() More...
|
|
Inherits DLPF.
void PD::setGain |
( |
float |
Kp, |
|
|
float |
Kd |
|
) |
| |
|
inline |
Set gains.
- Parameters
-
Kp | Proportional gain |
Kd | Dissipative (derivative) gain |
virtual float PD::update |
( |
float |
pos, |
|
|
float |
setpoint |
|
) |
| |
|
inlinevirtual |
Computes the PD control from the given error.
- Parameters
-
- Returns
- - Kp * val - Kd * (filtered velocity)
The documentation for this class was generated from the following file: