|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
Internal PID used by HoloDrive / HDrive. More...
#include <holo_drive.hpp>
Public Member Functions | |
| double | compute (double error) |
| Compute output using derivative on error. | |
| double | compute (double error, double measured) |
| Compute output using derivative on measurement (suppresses derivative kick on target changes). | |
| void | reset () |
| Zero out integral and previous-state history. | |
| void | set (double p, double i=0, double d=0) |
| Set all three gains in one call. | |
Public Attributes | |
| double | kP = 0 |
| Proportional gain. | |
| double | kI = 0 |
| Integral gain. | |
| double | kD = 0 |
| Derivative gain. | |
| double | integral = 0 |
| Accumulated integral term. | |
| double | integralCap = 1000.0 |
Same gating semantics as LightPID::integralCap: > 0 enables the clamp. | |
| double | prev_error = 0 |
| Previous-cycle error. | |
| double | prev_measured = 0 |
| Previous-cycle measurement (for derivative-on-measurement). | |
| bool | seeded_err = false |
Whether prev_error is valid. | |
| bool | seeded_meas = false |
Whether prev_measured is valid. | |
Internal PID used by HoloDrive / HDrive.
Distinct from light::PID — no exit-condition machinery, supports both error-derivative and measurement-derivative variants.
Definition at line 36 of file holo_drive.hpp.
|
inline |
Compute output using derivative on error.
| error | current error |
Definition at line 57 of file holo_drive.hpp.
|
inline |
Compute output using derivative on measurement (suppresses derivative kick on target changes).
| error | current error |
| measured | current sensor measurement |
Definition at line 78 of file holo_drive.hpp.
|
inline |
Zero out integral and previous-state history.
Definition at line 91 of file holo_drive.hpp.
|
inline |
Set all three gains in one call.
Definition at line 100 of file holo_drive.hpp.
| double light::HoloPID::integral = 0 |
Accumulated integral term.
Definition at line 40 of file holo_drive.hpp.
| double light::HoloPID::integralCap = 1000.0 |
Same gating semantics as LightPID::integralCap: > 0 enables the clamp.
Default chosen to match LightPID; set to ≤ 0 to disable.
Definition at line 45 of file holo_drive.hpp.
| double light::HoloPID::kD = 0 |
Derivative gain.
Definition at line 39 of file holo_drive.hpp.
| double light::HoloPID::kI = 0 |
Integral gain.
Definition at line 38 of file holo_drive.hpp.
| double light::HoloPID::kP = 0 |
Proportional gain.
Definition at line 37 of file holo_drive.hpp.
| double light::HoloPID::prev_error = 0 |
Previous-cycle error.
Definition at line 46 of file holo_drive.hpp.
| double light::HoloPID::prev_measured = 0 |
Previous-cycle measurement (for derivative-on-measurement).
Definition at line 47 of file holo_drive.hpp.
| bool light::HoloPID::seeded_err = false |
Whether prev_error is valid.
Definition at line 48 of file holo_drive.hpp.
| bool light::HoloPID::seeded_meas = false |
Whether prev_measured is valid.
Definition at line 49 of file holo_drive.hpp.