Smart Knob Controller

Simple PID controller class for embedded control loops. More...

#include <PID.h>

Public Member Functions

 PID (float kp, float ki, float kd, TIM_HandleTypeDef *htim)
 Constructs a PID controller with specified gains.
float update (float error)
 Updates the PID output based on the current error.
void reset ()
 Resets the integral and previous error states.

Detailed Description

Simple PID controller class for embedded control loops.

Constructor & Destructor Documentation

◆ PID()

PID::PID ( float kp,
float ki,
float kd,
TIM_HandleTypeDef * htim )

Constructs a PID controller with specified gains.

Parameters
kpProportional gain.
kiIntegral gain.
kdDerivative gain.
htimPointer to hardware timer for timekeeping.

Member Function Documentation

◆ update()

float PID::update ( float error)

Updates the PID output based on the current error.

Parameters
errorDifference between target and actual value.
Returns
Control output based on PID calculation.

The documentation for this class was generated from the following files:
  • C:/Users/nickl/OneDrive - Cal Poly/POLY4TH/SPRING'25/507/LAB WORKSPACE/SmartKnobController_REV2/Core/DoxCommd/PID.h
  • C:/Users/nickl/OneDrive - Cal Poly/POLY4TH/SPRING'25/507/LAB WORKSPACE/SmartKnobController_REV2/Core/DoxCommd/PID.cpp