LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
light::HoloPID Struct Reference

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.
 

Detailed Description

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.

Member Function Documentation

◆ compute() [1/2]

double light::HoloPID::compute ( double  error)
inline

Compute output using derivative on error.

Parameters
errorcurrent error

Definition at line 57 of file holo_drive.hpp.

◆ compute() [2/2]

double light::HoloPID::compute ( double  error,
double  measured 
)
inline

Compute output using derivative on measurement (suppresses derivative kick on target changes).

Parameters
errorcurrent error
measuredcurrent sensor measurement

Definition at line 78 of file holo_drive.hpp.

◆ reset()

void light::HoloPID::reset ( )
inline

Zero out integral and previous-state history.

Definition at line 91 of file holo_drive.hpp.

◆ set()

void light::HoloPID::set ( double  p,
double  i = 0,
double  d = 0 
)
inline

Set all three gains in one call.

Definition at line 100 of file holo_drive.hpp.

Member Data Documentation

◆ integral

double light::HoloPID::integral = 0

Accumulated integral term.

Definition at line 40 of file holo_drive.hpp.

◆ integralCap

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.

◆ kD

double light::HoloPID::kD = 0

Derivative gain.

Definition at line 39 of file holo_drive.hpp.

◆ kI

double light::HoloPID::kI = 0

Integral gain.

Definition at line 38 of file holo_drive.hpp.

◆ kP

double light::HoloPID::kP = 0

Proportional gain.

Definition at line 37 of file holo_drive.hpp.

◆ prev_error

double light::HoloPID::prev_error = 0

Previous-cycle error.

Definition at line 46 of file holo_drive.hpp.

◆ prev_measured

double light::HoloPID::prev_measured = 0

Previous-cycle measurement (for derivative-on-measurement).

Definition at line 47 of file holo_drive.hpp.

◆ seeded_err

bool light::HoloPID::seeded_err = false

Whether prev_error is valid.

Definition at line 48 of file holo_drive.hpp.

◆ seeded_meas

bool light::HoloPID::seeded_meas = false

Whether prev_measured is valid.

Definition at line 49 of file holo_drive.hpp.


The documentation for this struct was generated from the following file: