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

Lightweight PID controller used by characterization helpers. More...

#include <extras.hpp>

Public Member Functions

 LightPID (float kP, float kI, float kD)
 Construct with gains.
 
float update (float error)
 Advance one step.
 
void reset ()
 Zero out the integral and previous-error history.
 

Public Attributes

float kP
 
float kI
 
float kD
 Gains.
 
float prevError = 0
 Previous-cycle error.
 
float integral = 0
 Accumulated integral term.
 
float integralCap = 1000.0f
 Anti-windup clamp (set 0 to disable).
 

Detailed Description

Lightweight PID controller used by characterization helpers.

Distinct from light::PID — no exit conditions, no telemetry, just kP/kI/kD with an integral cap.

Definition at line 95 of file extras.hpp.

Constructor & Destructor Documentation

◆ LightPID()

LightPID::LightPID ( float  kP,
float  kI,
float  kD 
)
inline

Construct with gains.

Definition at line 102 of file extras.hpp.

Member Function Documentation

◆ reset()

void LightPID::reset ( )
inline

Zero out the integral and previous-error history.

Definition at line 123 of file extras.hpp.

◆ update()

float LightPID::update ( float  error)
inline

Advance one step.

Parameters
errorcurrent error
Returns
control output

Definition at line 111 of file extras.hpp.

Member Data Documentation

◆ integral

float LightPID::integral = 0

Accumulated integral term.

Definition at line 98 of file extras.hpp.

◆ integralCap

float LightPID::integralCap = 1000.0f

Anti-windup clamp (set 0 to disable).

Definition at line 99 of file extras.hpp.

◆ kD

float LightPID::kD

Gains.

Definition at line 96 of file extras.hpp.

◆ kI

float LightPID::kI

Definition at line 96 of file extras.hpp.

◆ kP

float LightPID::kP

Definition at line 96 of file extras.hpp.

◆ prevError

float LightPID::prevError = 0

Previous-cycle error.

Definition at line 97 of file extras.hpp.


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